#include <bits/stdc++.h>
using namespace std;
int n;
int a[111][111];
char c[111];
int main() {
  int i, j, k;
  int p, q, r;
  int t, tt, ttt;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s", c);
    for (j = 1; j <= n; j++) {
      if (c[j - 1] == 'E')
        a[i][j] = 1;
      else
        a[i][j] = 0;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (a[i][j] == 0) break;
    }
    if (j == n + 1) break;
  }
  if (i != n + 1) {
    for (j = 1; j <= n; j++) {
      for (i = 1; i <= n; i++) {
        if (a[i][j] == 0) break;
      }
      if (i == n + 1) break;
    }
    if (j != n + 1) {
      printf("-1");
    } else {
      for (j = 1; j <= n; j++) {
        for (i = 1; i <= n; i++) {
          if (a[i][j] == 0) {
            printf("%d %d\n", i, j);
            break;
          }
        }
      }
    }
  } else {
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (a[i][j] == 0) {
          printf("%d %d\n", i, j);
          break;
        }
      }
    }
  }
  scanf(" ");
  return 0;
}
