#include <bits/stdc++.h>
using namespace std;
int n, rowcount, colcount, row[1005], col[1005];
char str[1050][1510];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] != 'E') {
        if (row[i] == 0) rowcount++;
        if (col[j] == 0) colcount++;
        col[j] = 1;
        row[i] = 1;
      }
    }
  }
  if (rowcount != n && colcount != n) {
    printf("-1");
    return 0;
  }
  if (rowcount == n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (str[i][j] != 'E') {
          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 (str[j][i] != 'E') {
          printf("%d %d\n", j + 1, i + 1);
          break;
        }
      }
    }
  }
}
