#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int MINF = -1000000000000000000;
long long int powmod(long long int a, long long int b) {
  long long int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
const long long int MAXN = 1000000005;
bool abc(char c) {
  for (int i = (0); i < (26); i++) {
    if (char('a' + i) == c) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    long long int n = 0, m, flag = 0, sum = 0, cnt;
    cin >> n;
    char a[n][n];
    int row[n], col[n], p[n], q[n];
    memset(row, 0, sizeof(row));
    memset(col, 0, sizeof(col));
    memset(p, 0, sizeof(p));
    memset(q, 0, sizeof(q));
    vector<pair<int, int>> ans;
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (n); j++) {
        cin >> a[i][j];
        if (a[i][j] == 'E') {
          row[i]++;
          col[j]++;
        }
      }
    }
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (n); j++) {
        if (row[i] == n && col[j] == n) flag = -1;
      }
    }
    for (int i = (0); i < (n); i++) {
      row[i] = n - row[i];
      col[i] = n - col[i];
    }
    if (flag == 0) {
      for (int i = (0); i < (n); i++) {
        for (int j = (0); j < (n); j++) {
          if (a[i][j] == '.') {
            ans.push_back(make_pair(i + 1, j + 1));
            break;
          }
        }
      }
      if (ans.size() != n) {
        ans.clear();
        for (int i = (0); i < (n); i++) {
          for (int j = (0); j < (n); j++) {
            if (a[j][i] == '.') {
              ans.push_back(make_pair(j + 1, i + 1));
              break;
            }
          }
        }
      }
      for (int i = (0); i < (ans.size()); i++) {
        cout << ans[i].first << " " << ans[i].second << endl;
      }
    } else
      cout << flag << endl;
  }
  return 0;
}
