#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char tmp;
  int mat[n + 5][n + 5];
  map<int, int> trace, tracey;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> tmp;
      if (tmp == 'E')
        mat[i][j] = 0;
      else
        mat[i][j] = 1;
    }
  }
  int ok = 1;
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (j < n) {
      if (mat[i][j]) {
        trace.insert(pair<int, int>(i + 1, j + 1));
        break;
      } else if (j == n - 1) {
        ok = 0;
      }
      j++;
    }
    if (!ok) break;
  }
  if (ok) {
    for (map<int, int>::const_iterator it = trace.begin(); it != trace.end();
         ++it) {
      cout << it->first << " " << it->second << endl;
    }
  } else {
    ok = 1;
    for (int j = 0; j < n; j++) {
      int i = 0;
      while (i < n) {
        if (mat[i][j]) {
          tracey.insert(pair<int, int>(j + 1, i + 1));
          break;
        } else if (i == n - 1) {
          ok = 0;
        }
        i++;
      }
      if (!ok) break;
    }
    if (ok) {
      for (map<int, int>::const_iterator it = tracey.begin();
           it != tracey.end(); ++it) {
        cout << it->second << " " << it->first << endl;
      }
    } else
      cout << -1 << endl;
  }
  return 0;
}
