#include <bits/stdc++.h>
using namespace std;
char g[110][110];
int col[110], lin[110];
int main() {
  int n;
  scanf("%d", &n);
  int r = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", g[i]);
    for (int j = 0; j < n; j++) {
      if (g[i][j] == 'E') {
        col[j]++, lin[i]++;
        if (col[j] == n) r |= 1;
        if (lin[i] == n) r |= 2;
      }
    }
  }
  if (r == 3)
    printf("-1\n");
  else {
    if (r == 1) {
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++) {
          if (g[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
        }
    } else {
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++) {
          if (g[j][i] == '.') {
            printf("%d %d\n", j + 1, i + 1);
            break;
          }
        }
    }
  }
  return 0;
}
