#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int MM = 998244353;
const long double PI = acos(-1);
const long long INF = 2e18;
template <typename T, typename T1>
void amax(T &a, T1 b) {
  if (b > a) a = b;
}
template <typename T, typename T1>
void amin(T &a, T1 b) {
  if (b < a) a = b;
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
long long power(long long b, long long e, long long m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long modinv(long long a, long long m) { return power(a, m - 2, m); }
int TLE_TERROR() {
  long long n;
  cin >> n;
  char a[n][n];
  set<long long> r, c;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == '.') {
        r.insert(i);
        c.insert(j);
      }
    }
  }
  long long rr = r.size();
  long long cc = c.size();
  if (rr != n && cc != n) {
    cout << -1;
    return 0;
  }
  if (rr == n) {
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (a[i][j] == '.') {
          if (r.count(i)) {
            cout << i + 1 << " " << j + 1 << "\n";
            r.erase(i);
          }
        }
      }
    }
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (a[i][j] == '.') {
        if (c.count(j)) {
          cout << i + 1 << " " << j + 1 << "\n";
          c.erase(j);
        }
      }
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int TESTS = 1;
  while (TESTS--) TLE_TERROR();
  return 0;
}
