#include <bits/stdc++.h>
using namespace std;
int a[200], b[200];
char mp[200][200];
int n, m;
int main() {
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  scanf("%d", &n);
  char c;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      scanf(" %c", &mp[i][j]);
      if (mp[i][j] == 'E') {
        a[i]++;
        b[j]++;
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (a[i] == n && b[j] == n) {
        cout << -1 << endl;
        return 0;
      }
    }
  bool flag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == n) {
      for (int k = 1; k <= n; k++)
        for (int j = 1; j <= n; j++) {
          if (mp[j][k] == '.') {
            cout << j << " " << k << endl;
            break;
          }
        }
      flag = 1;
      break;
    }
  }
  if (!flag) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (mp[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
  }
  return 0;
}
