#include <bits/stdc++.h>
using namespace std;
char a[111][111];
long i, j, p, n;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) cin >> a[i][j];
  vector<long> a1, a2;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      bool f = false;
      for (p = 1; p <= n; p++) {
        if (a[p][j] != 'E') f = true;
        if (a[i][p] != 'E') f = true;
      }
      if (!f && a[i][j] == 'E') {
        cout << -1;
        return 0;
      }
    }
  bool f = true;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++)
      if (a[i][j] != 'E') goto next;
    f = false;
  next:;
  }
  if (f) {
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++)
        if (a[i][j] != 'E') {
          cout << i << " " << j << endl;
          goto next2;
        }
    next2:;
    }
  } else {
    for (j = 1; j <= n; j++) {
      for (i = 1; i <= n; i++)
        if (a[i][j] != 'E') {
          cout << i << " " << j << endl;
          goto next3;
        }
    next3:;
    }
  }
  return 0;
}
