#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int inf = 1 << 10;
const long long mod = 1000000007;
int n;
char s[110][110];
int a[110], b[110], c[110], d[110], k = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  int f = 1;
  int aaa = 0, bbb = 0;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++)
      if (s[i][j] == 'E') cnt++;
    if (cnt == n) {
      aaa = 1;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++)
      if (s[j][i] == 'E') cnt++;
    if (cnt == n) {
      bbb = 1;
      break;
    }
  }
  if (aaa == 1 && bbb == 1)
    cout << -1 << endl;
  else {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++)
        if (s[i][j] == '.') {
          c[++k] = i;
          d[k] = j;
          break;
        }
    }
    if (k == n) {
      for (int i = 1; i <= k; i++) cout << c[i] << " " << d[i] << endl;
    } else {
      k = 0;
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++)
          if (s[j][i] == '.') {
            c[++k] = j;
            d[k] = i;
            break;
          }
      }
      for (int i = 1; i <= k; i++) cout << c[i] << " " << d[i] << endl;
    }
  }
  return 0;
}
