#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   using namespace std;   long long max(long long a, long long b) {     if (a > b) {       return a;     } else {       return b;     }   }   long long min(long long a, long long b) {     if (a < b) {       return a;     } else {       return b;     }   }   long long sz(vector<long long> v) {     if (v.empty()) {       return 0;     } else {       return v.size();     }   }   long long sz(set<long long> v) {     if (v.empty()) {       return 0;     } else {       return v.size();     }   }   long long sz(vector<pair<long long, long long> > v) {     if (v.empty()) {       return 0;     } else {       return v.size();     }   }   long long power(long long b, long long e) {     if (e == 0) return 1;     if (e % 2)       return ((b * power((b) * (b), (e - 1) / 2)));     else       return power((b) * (b), e / 2);   }   long long modpower(long long b, long long e, long long q) {     long long MOD = q;     if (e == 0) return 1;     if (e % 2)       return ((b % MOD) * modpower((b % MOD) * (b % MOD), (e - 1) / 2, q)) % MOD;     else       return modpower((b % MOD) * (b % MOD), e / 2, q) % MOD;   }   void dpv(vector<long long> v) {     for (long long i = 0; i < v.size(); i++) {       cout << v[i] <<    ;     }     cout <<   n ;   }   void dpv(vector<pair<long long, long long> > v) {     for (long long i = 0; i < v.size(); i++) {       cout << v[i].first <<     << v[i].second <<   n ;     }   }   void dpv(set<long long> v) {     for (auto i : v) {       cout << i <<    ;     }     cout <<   n ;   }   void oblivious() {     long long n;     cin >> n;     string s[n];     char c[n][n];     for (long long i = 0; i < n; i++) {       cin >> s[i];       for (long long j = 0; j < s[i].length(); j++) {         c[i][j] = s[i][j];       }     }     long long r[n], co[n];     memset(r, 0, sizeof(r));     memset(co, 0, sizeof(co));     for (long long i = 0; i < n; i++) {       for (long long j = 0; j < n; j++) {         if (c[i][j] ==  . ) {           r[i] = 1;           co[j] = 1;         }       }     }     long long f1 = 1;     long long f2 = 1;     for (long long i = 0; i < n; i++) {       if (r[i] == 0) {         f1 = 0;         break;       }     }     for (long long i = 0; i < n; i++) {       if (co[i] == 0) {         f2 = 0;         break;       }     }     if (f1 || f2) {       if (f1 && f2) {         for (long long i = 0; i < n; i++) {           for (long long j = 0; j < n; j++) {             if (c[i][j] ==  . ) {               cout << i + 1 <<     << j + 1 <<   n ;               break;             }           }         }       } else if (f1) {         for (long long i = 0; i < n; i++) {           for (long long j = 0; j < n; j++) {             if (c[i][j] ==  . ) {               cout << i + 1 <<     << j + 1 <<   n ;               break;             }           }         }       } else if (f2) {         for (long long i = 0; i < n; i++) {           for (long long j = 0; j < n; j++) {             if (c[j][i] ==  . ) {               cout << j + 1 <<     << i + 1 <<   n ;               break;             }           }         }       }     } else {       cout <<  -1  <<   n ;     }   }   signed main() {     long long t = 1;     while (t--) {       oblivious();     }     return 0;   }