#include <bits/stdc++.h>
using namespace std;
double dp[20010][10];
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int> > v(n, vector<int>(n));
  for (int i = 0; i < (n); ++i) {
    char c[102];
    scanf("%s", c);
    for (int j = 0; j < (n); ++j)
      if (c[j] != 'E') v[i][j] = 1;
  }
  vector<int> z(n, -1);
  bool fin = 1;
  for (int i = 0; i < (n); ++i) {
    bool ok = 0;
    for (int j = 0; j < (n); ++j) {
      if (v[i][j] == 1) {
        z[i] = j;
        ok = 1;
        break;
      }
    }
    if (!ok) {
      fin = 0;
      break;
    }
  }
  if (fin) {
    for (int i = 0; i < (n); ++i) {
      printf("%d %d\n", i + 1, z[i] + 1);
    }
    return 0;
  }
  fin = 1;
  for (int i = 0; i < (n); ++i) {
    bool ok = 0;
    for (int j = 0; j < (n); ++j) {
      if (v[j][i] == 1) {
        z[i] = j;
        ok = 1;
        break;
      }
    }
    if (!ok) {
      fin = 0;
      break;
    }
  }
  if (fin) {
    for (int i = 0; i < (n); ++i) {
      printf("%d %d\n", z[i] + 1, i + 1);
    }
    return 0;
  }
  printf("-1\n");
  return 0;
}
