#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<list<int> > rows(n);
  vector<list<int> > columns(n);
  getchar();
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (n); ++j) {
      char c = getchar();
      if (c != 'E') {
        rows[i].push_back(j);
        columns[j].push_back(i);
      }
    }
    getchar();
  }
  bool a = true;
  for (int i = 0; i < (n); ++i) {
    if (rows[i].size() == 0) {
      a = false;
    }
  }
  bool b = true;
  for (int i = 0; i < (n); ++i) {
    if (columns[i].size() == 0) b = false;
  }
  if (a) {
    for (int i = 0; i < (n); ++i) {
      printf("%d %d\n", i + 1, rows[i].front() + 1);
    }
  } else if (b) {
    for (int i = 0; i < (n); ++i) {
      printf("%d %d\n", columns[i].front() + 1, i + 1);
    }
  } else {
    printf("-1\n");
  }
  return 0;
}
