#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, flagi = 1, flagj = 1;
  char s[1];
  cin >> n;
  int evil[n][n];
  memset(evil, 0, sizeof(evil));
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      cin >> s[0];
      if ((int)s[0] == 69) {
        evil[i][j] = 1;
      }
    }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (evil[i][j] == 0) break;
    }
    if (j == n) {
      flagi = 0;
      break;
    }
  }
  if (flagi == 1) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (evil[i][j] == 0) {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
    return 0;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (evil[j][i] == 0) break;
    }
    if (j == n) {
      flagj = 0;
      break;
    }
  }
  if (flagj == 1) {
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++) {
        if (evil[j][i] == 0) {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    return 0;
  } else
    cout << "-1" << endl;
  return 0;
}
