#include <bits/stdc++.h>
char map[111][111];
int row[111], col[111];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i != n; i++) scanf("%s", map[i]);
  for (int i = 0; i != n; i++) {
    int cnt = 0;
    for (int j = 0; j != n; j++)
      if (map[i][j] == 'E') cnt++;
    row[i] = cnt;
  }
  for (int j = 0; j != n; j++) {
    int cnt = 0;
    for (int i = 0; i != n; i++)
      if (map[i][j] == 'E') cnt++;
    col[j] = cnt;
  }
  bool hans = true;
  for (int i = 0; i != n; i++)
    for (int j = 0; j != n; j++)
      if (row[i] == n && col[j] == n) hans = false;
  if (!hans) {
    puts("-1");
    return 0;
  }
  int hor = true;
  for (int i = 0; i != n; i++) {
    bool ok = false;
    for (int j = 0; j != n; j++)
      if (map[i][j] == '.') ok = true;
    if (!ok) hor = false;
  }
  if (hor) {
    for (int i = 0; i != n; i++) {
      for (int j = 0; j != n; j++) {
        if (map[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
      }
    }
  } else {
    for (int j = 0; j != n; j++) {
      for (int i = 0; i != n; i++) {
        if (map[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
      }
    }
  }
}
