#include <bits/stdc++.h>
using namespace std;
int i, j, ver, a[105][105], n, verl = 1, verc = 1;
char x;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> x;
      if (x == 'E') {
        a[i][j] = -1;
      } else {
        a[i][0] = 1;
        a[0][j] = 1;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (a[i][0] != 1) {
      verl = 0;
    }
    if (a[0][i] != 1) {
      verc = 0;
    }
  }
  if (verl == verc && verc == 0) {
    cout << -1;
  } else {
    if (verl == 1) {
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) {
          if (a[i][j] != -1) {
            cout << i << " " << j << '\n';
            break;
          }
        }
      }
    } else {
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) {
          if (a[j][i] != -1) {
            cout << j << " " << i << '\n';
            break;
          }
        }
      }
    }
  }
  return 0;
}
