#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, p = 0;
  cin >> n;
  char a[n][n];
  for (int i = 0; i < n; i++) {
    m = 1;
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] != 'E') m = 0;
    }
    if (m == 1) p = 1;
  }
  for (int i = 0; i < n; i++) {
    m = 1;
    for (int j = 0; j < n; j++) {
      if (a[j][i] != 'E') m = 0;
    }
    if (m == 1 and p == 1) {
      cout << "-1" << endl;
      return 0;
    }
  }
  if (p == 1) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (a[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (a[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  }
  return 0;
}
