#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string s[n];
  long long flg = 1;
  long long ar[n];
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    long long flag = 0;
    long long pos = -1;
    for (long long j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        flag = 1;
        pos = j;
        break;
      }
    }
    if (flag == 0) {
      flg = 0;
    }
    ar[i] = pos;
  }
  if (!flg) {
    flg = 1;
    long long ar[n];
    for (long long i = 0; i < n; i++) {
      long long flag = 0;
      long long pos = -1;
      for (long long j = 0; j < n; j++) {
        if (s[j][i] == '.') {
          flag = 1;
          pos = j;
          break;
        }
      }
      if (flag == 0) {
        flg = 0;
        break;
      }
      ar[i] = pos;
    }
    if (!flg)
      cout << -1;
    else {
      for (long long i = 0; i < n; i++) {
        cout << ar[i] + 1 << " " << i + 1 << "\n";
      }
    }
    return 0;
  } else {
    for (long long i = 0; i < n; i++) {
      cout << i + 1 << " " << ar[i] + 1 << "\n";
    }
  }
}
