fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n=0;
  8. cin>>n;
  9. vector<string> v(n);
  10. for (int i=0;i<n;i++) {
  11. cin>>v[i];
  12. }
  13. vector<int> pos(n,-1);
  14. for (int i=0;i<n;i++) {
  15. for (int j=0;j<n;j++) {
  16. if (v[i][j]=='.') {
  17. pos[i]=j;
  18. }
  19. }
  20. }
  21. for (int i=0;i<n;i++) {
  22. if (pos[i]==-1) {
  23. cout<<-1<<endl;
  24. exit(0);
  25. }
  26. }
  27. for (int i=0;i<n;i++) {
  28. cout<<i+1<<" "<<pos[i]+1<<endl;
  29. }
  30. }
Success #stdin #stdout 0s 2856KB
stdin
Standard input is empty
stdout
Standard output is empty