#include <bits/stdc++.h>
using namespace std;
char op[110][110];
int okN[110];
int okM[110];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%s", &op[i][1]);
  }
  memset(okN, 0, sizeof(okN));
  memset(okM, 0, sizeof(okM));
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (op[i][j] == '.') {
        okN[i] = 1;
        okM[j] = 1;
      }
    }
  }
  int ok1 = 1, ok2 = 1;
  for (int i = 1; i <= N; i++) {
    if (!okN[i]) {
      ok1 = 0;
      break;
    }
  }
  for (int i = 1; i <= N; i++) {
    if (!okM[i]) {
      ok2 = 0;
      break;
    }
  }
  if (ok1) {
    for (int i = 1; i <= N; i++) {
      for (int j = 1; j <= N; j++) {
        if (op[i][j] == '.') {
          printf("%d %d\n", i, j);
          break;
        }
      }
    }
  } else if (ok2) {
    for (int j = 1; j <= N; j++) {
      for (int i = 1; i <= N; i++) {
        if (op[i][j] == '.') {
          printf("%d %d\n", i, j);
          break;
        }
      }
    }
  } else
    printf("-1\n");
  return 0;
}
