#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n;     cin >> n;     char c[n][n];     for (long long i = 0; i < n; i++) {       for (long long j = 0; j < n; j++) {         cin >> c[i][j];       }     }     bool re = 1, ce = 1;     for (long long i = 0; i < n; i++) {       re = 1;       for (long long j = 0; j < n; j++) {         if (c[i][j] !=  E ) {           re = 0;         }       }       if (re == 1) {         break;       }     }     for (long long j = 0; j < n; j++) {       ce = 1;       for (long long i = 0; i < n; i++) {         if (c[i][j] !=  E ) {           ce = 0;         }       }       if (ce == 1) {         break;       }     }     if (re == 1 && ce == 1) {       cout <<  -1 ;       return 0;     }     if (re == 1) {       for (long long j = 0; j < n; j++) {         for (long long i = 0; i < n; i++) {           if (c[i][j] !=  E ) {             cout << i + 1 <<     << j + 1 <<   n ;             break;           }         }       }     } else {       for (long long i = 0; i < n; i++) {         for (long long j = 0; j < n; j++) {           if (c[i][j] !=  E ) {             cout << i + 1 <<     << j + 1 <<   n ;             break;           }         }       }     }   }   