#include <bits/stdc++.h>
using namespace std;
int i, j, N, M, x, y;
char temp[256];
vector<vector<int> > g;
vector<int> ans1, ans2;
int main() {
  scanf("%d\n", &N);
  int result = N;
  char is_evil1 = false, is_evil2 = false;
  g = vector<vector<int> >(N, vector<int>(N, 0));
  ans1 = ans2 = vector<int>(N, -1);
  for (i = 0; i < N; ++i) {
    gets(temp);
    for (j = 0; j < N; ++j) {
      if (temp[j] == 'E') g[i][j] = 1;
      if (temp[j] == '.') ans1[i] = j;
    }
    if (ans1[i] == -1) is_evil1 = true;
  }
  for (i = 0; i < N; ++i) {
    for (j = 0; j < N; ++j) {
      if (g[j][i] == 0) {
        ans2[i] = j;
      }
    }
    if (ans2[i] == -1) is_evil2 = true;
  }
  if (!is_evil1) {
    for (i = 0; i < N; ++i) printf("%d %d\n", i + 1, ans1[i] + 1);
  } else if (!is_evil2) {
    for (i = 0; i < N; ++i) printf("%d %d\n", ans2[i] + 1, i + 1);
  } else
    printf("-1");
  return 0;
}
