#include <bits/stdc++.h>
using namespace std;
int main() {
  string b[100];
  int which[100];
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> b[i];
  for (int m = 0; m < 2; m++) {
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        char c = m ? b[j][i] : b[i][j];
        if (c != 'E') {
          which[i] = j;
          goto nexti;
        }
      }
      goto nextm;
    nexti:;
    }
    for (int i = 0; i < N; i++) {
      if (!m)
        cout << (i + 1) << " " << (which[i] + 1) << endl;
      else
        cout << (which[i] + 1) << " " << (i + 1) << endl;
    }
    return 0;
  nextm:;
  }
  cout << "-1" << endl;
}
