#include <bits/stdc++.h>
using namespace std;
bool A, B, C, R;
int N;
string G[101];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> G[i];
  for (int i = 0; i < N; i++) {
    A = B = true;
    for (int j = 0; j < N; j++) A &= G[i][j] == 'E', B &= G[j][i] == 'E';
    R |= A, C |= B;
  }
  if (C && R)
    cout << "-1";
  else
    for (int i = 0; i < N; i++)
      for (int j = 0; j < N; j++) {
        if (C && G[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << "\n";
          break;
        }
        if (!C && G[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << "\n";
          break;
        }
      }
}
