#include <bits/stdc++.h>
using namespace std;
int N;
char A[110][110];
int row[110], col[110], TRUE;
bool t;
void DFS(int c) {
  int r;
  if (c == N + 1) {
    t = 1;
    return;
  }
  for (r = 1; r <= N; r++) {
    if (A[r][c] != 'E') {
      col[c] = 1;
      DFS(c + 1);
      col[c] = 0;
      if (t) {
        cout << r << " " << c << endl;
        return;
      }
    }
  }
}
void DFS1(int r) {
  int c;
  if (r == N + 1) {
    t = 1;
    return;
  }
  for (c = 1; c <= N; c++) {
    if (A[r][c] != 'E') {
      col[c] = 1;
      DFS1(r + 1);
      col[c] = 0;
      if (t) {
        cout << r << " " << c << endl;
        return;
      }
    }
  }
}
int main() {
  int i, j;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) scanf("%s", A[i] + 1);
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      if (A[i][j] == 'E') {
        row[i]++;
        col[j]++;
      }
    }
  }
  bool t1 = 0, t2 = 0;
  for (i = 1; i <= N; i++) {
    if (row[i] == N) t1 = 1;
    if (col[i] == N) t2 = 1;
  }
  if (t1 && t2) {
    printf("-1\n");
    return 0;
  }
  memset((row), (0), sizeof(row));
  memset((col), (0), sizeof(col));
  t = 0;
  if (t2)
    DFS1(1);
  else if (t1)
    DFS(1);
  else
    DFS(1);
  return 0;
}
