#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return ((!b) ? (a) : gcd(b, a % b));
}
const int maint = (1 << 30) - 1;
const long long int mall = (1LL << 62) - 1;
const int dir1[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
const int dir2[8][2] = {{0, 1},  {-1, 1}, {-1, 0}, {-1, -1},
                        {0, -1}, {1, -1}, {1, 0},  {1, 1}};
int NN;
int row, col;
char line[111][111];
int solve(void) {
  scanf("%d\n", &NN);
  for (int i = (int)0; i <= (int)NN - 1; ++i) scanf("%s\n", line[i]);
  row = col = 0;
  for (int i = (int)0; i <= (int)NN - 1; ++i) {
    int cnt = 0;
    for (int j = (int)0; j <= (int)NN - 1; ++j) cnt += line[i][j] == 'E';
    if (cnt == NN) row = 1;
  }
  for (int j = (int)0; j <= (int)NN - 1; ++j) {
    int cnt = 0;
    for (int i = (int)0; i <= (int)NN - 1; ++i) cnt += line[i][j] == 'E';
    if (cnt == NN) col = 1;
  }
  if (row == 0) {
    for (int i = (int)0; i <= (int)NN - 1; ++i) {
      for (int j = (int)0; j <= (int)NN - 1; ++j)
        if (line[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    }
  } else if (col == 0) {
    for (int j = (int)0; j <= (int)NN - 1; ++j) {
      for (int i = (int)0; i <= (int)NN - 1; ++i)
        if (line[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    }
  } else
    printf("-1\n");
  return 0;
}
int main(void) {
  solve();
  return 0;
}
