#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, row[1000] = {0}, col[1000] = {0}, a[1000][1000],
               hash[1000] = {0};
  char ch;
  cin >> n;
  for (i = 0; i < 1000; i++) {
    for (j = 0; j < 1000; j++) {
      a[i][j] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> ch;
      if (ch == 'E') {
        a[i][j] = 1;
        row[i]++;
        col[j]++;
      }
    }
  }
  int flag1 = 0, flag2 = 0;
  for (i = 0; i < n; i++) {
    if (row[i] == n) {
      flag1 = 1;
    }
    if (col[i] == n) {
      flag2 = 1;
    }
  }
  if (flag1 == 1 && flag2 == 1) {
    cout << -1;
    return 0;
  }
  if (flag1 == 0) {
    for (j = 0; j < n; j++) {
      for (i = 0; i < n; i++) {
        if (a[i][j] == 0 && hash[i] == 0) {
          hash[i] = 1;
          cout << i + 1 << " " << j + 1 << endl;
          continue;
        }
      }
    }
  } else if (flag2 == 0) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (a[i][j] == 0 && hash[j] == 0) {
          hash[j] = 1;
          cout << i + 1 << " " << j + 1 << endl;
          continue;
        }
      }
    }
  }
  return 0;
}
