#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[105];
  for (int i = 0; i < n; i++) cin >> s[i];
  bool r = true, c = true;
  for (int i = 0; i < n; i++) {
    bool f = false;
    for (int j = 0; j < n; j++) f |= s[i][j] == '.';
    r &= f;
  }
  for (int i = 0; i < n; i++) {
    bool f = false;
    for (int j = 0; j < n; j++) f |= s[j][i] == '.';
    c &= f;
  }
  if (!c && !r)
    cout << -1;
  else {
    if (r) {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)
          if (s[i][j] == '.') {
            cout << i + 1 << " " << j + 1 << "\n";
            break;
          }
      }
    } else {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)
          if (s[j][i] == '.') {
            cout << j + 1 << " " << i + 1 << "\n";
            break;
          }
      }
    }
  }
  return 0;
}
