#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  scanf("%lld", &N);
  char M[N][N], temp;
  bool baris_evil[N];
  bool kolom_evil[N];
  long long cnt[2];
  cnt[0] = cnt[1] = 0;
  memset(baris_evil, false, sizeof baris_evil);
  memset(kolom_evil, false, sizeof kolom_evil);
  for (long long i = 0; i < N; ++i) {
    scanf("%c", &temp);
    for (long long j = 0; j < N; ++j) {
      scanf("%c", &M[i][j]);
    }
  }
  for (long long i = 0; i < N; ++i) {
    bool benar = true;
    for (long long j = 0; j < N; ++j) {
      benar = benar && M[i][j] == 'E';
    }
    baris_evil[i] = benar;
    cnt[0] += benar;
  }
  for (long long j = 0; j < N; ++j) {
    bool benar = true;
    for (long long i = 0; i < N; ++i) {
      benar = benar && M[i][j] == 'E';
    }
    kolom_evil[j] = benar;
    cnt[1] += benar;
  }
  if (cnt[0] && cnt[1]) {
    cout << -1 << endl;
  } else {
    if (cnt[0]) {
      for (long long j = 0; j < N; ++j) {
        bool found = false;
        long long temp;
        for (long long i = 0; i < N && !found; ++i) {
          if (M[i][j] == '.') {
            temp = i;
            found = true;
          }
        }
        cout << temp + 1 << " " << j + 1 << endl;
      }
    } else {
      for (long long i = 0; i < N; ++i) {
        bool found = false;
        long long temp;
        for (long long j = 0; j < N && !found; ++j) {
          if (M[i][j] == '.') {
            temp = j;
            found = true;
          }
        }
        cout << i + 1 << " " << temp + 1 << endl;
      }
    }
  }
  return 0;
}
