#include <bits/stdc++.h>
using namespace std;
int main() {
  int cases = 1;
  while (cases--) {
    int n, ans = 0, k, flag;
    scanf("%d", &n);
    int m[n][n];
    char c;
    string crap;
    getline(cin, crap);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        c = getchar();
        if (c == '.') m[i][j] = 1;
        if (c == 'E') m[i][j] = 2;
      }
      getchar();
    }
    int i, j, oner = 0, onec = 0;
    for (i = 0; i < n; ++i) {
      for (j = 0; j < n; ++j) {
        if (m[i][j] == 1) break;
      }
      if (j == n) oner = 1;
    }
    for (i = 0; i < n; ++i) {
      for (j = 0; j < n; ++j) {
        if (m[j][i] == 1) break;
      }
      if (j == n) onec = 1;
    }
    if (onec && oner) {
      printf("-1");
      return 0;
    }
    if (oner) {
      for (j = 0; j < n; ++j) {
        for (i = 0; i < n; ++i) {
          if (m[i][j] == 1) {
            cout << i + 1 << " " << j + 1 << endl;
            break;
          }
        }
      }
      return 0;
    }
    if (onec) {
      for (i = 0; i < n; ++i) {
        for (j = 0; j < n; ++j) {
          if (m[i][j] == 1) {
            cout << i + 1 << " " << j + 1 << endl;
            break;
          }
        }
      }
      return 0;
    } else {
      for (i = 0; i < n; ++i) {
        for (j = 0; j < n; ++j) {
          if (m[i][j] == 1) {
            cout << i + 1 << " " << j + 1 << endl;
            break;
          }
        }
      }
      return 0;
    }
  }
  return 0;
}
