#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int mod = 1e9 + 7;
int dcmp(long double x, long double y) {
  return fabs(x - y) <= 1e-12 ? 0 : x < y ? -1 : 1;
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int n;
map<int, int> col, row;
int main() {
  fast();
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      char x;
      cin >> x;
      if (x != 'E') {
        col[j + 1] = i + 1;
        row[i + 1] = j + 1;
      }
    }
  }
  if (row.size() == n) {
    for (auto e : row) {
      cout << e.first << " " << e.second << '\n';
    }
    return 0;
  }
  if (col.size() == n) {
    for (auto e : col) {
      cout << e.second << " " << e.first << '\n';
    }
    return 0;
  }
  cout << -1;
  return 0;
}
