#include <bits/stdc++.h>
using namespace std;
int n;
char grid[101][101];
bool rw[101], cl[101];
int main() {
  bool f, r = 0, c = 0;
  int cnt;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", grid[i]);
    f = 1;
    for (int j = 0; j < n; ++j) {
      f &= (grid[i][j] == 'E');
      if (grid[i][j] == '.') rw[i] = cl[j] = 1;
    }
    c |= f;
  }
  for (int j = 0; j < n; ++j) {
    f = 1;
    for (int i = 0; i < n; ++i) {
      f &= (grid[i][j] == 'E');
    }
    r |= f;
  }
  if (r && c) {
    printf("-1\n");
  } else {
    cnt = 0;
    for (int i = 0; i < n; ++i) cnt += rw[i];
    if (cnt == n) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
          if (grid[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 (grid[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
        }
      }
    }
  }
  return 0;
}
