#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
void test_case() {
  long long n;
  cin >> n;
  string s[n];
  bool row = 0, col = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    bool f = 1;
    for (char& ch : s[i]) {
      if (ch != 'E') {
        f = 0;
        break;
      }
    }
    row |= f;
  }
  for (long long c = 0; c < n; c++) {
    bool f = 1;
    for (long long r = 0; r < n; r++) {
      if (s[r][c] != 'E') {
        f = 0;
        break;
      }
    }
    col |= f;
  }
  if (row && col) {
    cout << -1;
    return;
  }
  if (!row) {
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (s[i][j] == '.') {
          cout << i + 1 << ' ' << j + 1 << "\n";
          break;
        }
      }
    }
  } else {
    for (long long c = 0; c < n; c++) {
      for (long long r = 0; r < n; r++) {
        if (s[r][c] == '.') {
          cout << r + 1 << ' ' << c + 1 << "\n";
          break;
        }
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (long long i = 0; i < t; i++) {
    test_case();
  }
  return 0;
}
