#include <bits/stdc++.h>
const int INF = ~0U >> 1;
using namespace std;
int n, m, ans, flag;
int mp[102][102];
int xx[102], yy[102];
char s[102];
int main() {
  int i, j, cnt1, cnt2;
  while (~scanf("%d", &n)) {
    memset(mp, 0, sizeof(mp));
    memset(xx, 0, sizeof(yy));
    memset(yy, 0, sizeof(yy));
    for (i = 1; i <= n; i++) {
      scanf("%s", s);
      for (j = 1; j <= n; j++) {
        if (s[j - 1] == 'E')
          mp[i][j] = 1;
        else {
          xx[i] = 1;
          yy[j] = 1;
        }
      }
    }
    cnt1 = cnt2 = 0;
    for (i = 1; i <= n; i++) {
      cnt1 += xx[i];
      cnt2 += yy[i];
    }
    if (cnt1 == n) {
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) {
          if (!mp[i][j]) {
            printf("%d %d\n", i, j);
            break;
          }
        }
      }
    } else if (cnt2 == n) {
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) {
          if (!mp[j][i]) {
            printf("%d %d\n", j, i);
            break;
          }
        }
      }
    } else
      printf("-1\n");
  }
  return 0;
}
