#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000000;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > r(n), c(n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      char t;
      cin >> t;
      if (t != 'E') {
        r[i].push_back(j);
        c[j].push_back(i);
      }
    }
  }
  bool good = true;
  for (int i = 0; i < n; ++i) {
    if (r[i].size() == 0) good = false;
  }
  if (good) {
    for (int i = 0; i < n; ++i) {
      cout << i + 1 << ' ' << r[i][0] + 1 << endl;
    }
    return 0;
  }
  good = true;
  for (int i = 0; i < n; ++i) {
    if (c[i].size() == 0) good = false;
  }
  if (good) {
    for (int i = 0; i < n; ++i) {
      cout << c[i][0] + 1 << ' ' << i + 1 << endl;
    }
    return 0;
  }
  cout << -1;
  return 0;
}
