#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  const int mn = 102;
  int ar[mn][mn];
  for (int i = 0; i < mn; ++i) {
    for (int j = 0; j < mn; ++j) {
      ar[i][j] = 0;
    }
  }
  cin >> n;
  cin.get();
  char ch;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      ch = getchar();
      if (ch == 'E') {
        ar[i][j] = 2;
        ar[0][j] += 1;
        ar[i][0] += 1;
      } else {
        ar[n + 1][j] += 1;
        ar[i][n + 1] += 1;
      }
    }
    cin.get();
  }
  bool canv = true;
  bool canh = true;
  for (int i = 1; i <= n; ++i) {
    if (ar[n + 1][i] == 0) {
      canh = false;
    }
    if (ar[i][n + 1] == 0) {
      canv = false;
    }
  }
  if (canv) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (ar[i][j] == 0) {
          cout << i << " " << j << endl;
          break;
        }
      }
    }
  } else if (canh) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (ar[j][i] == 0) {
          cout << j << " " << i << endl;
          break;
        }
      }
    }
  } else {
    cout << "-1" << endl;
  }
  return 0;
}
