#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, row = 0, col = 0;
  cin >> n;
  char a[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++) {
    int f1 = 0, f2 = 0;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == '.') f1 = 1;
      if (a[j][i] == '.') f2 = 1;
    }
    if (!f1) row = 1;
    if (!f2) col = 1;
  }
  if (row && col)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (!row) {
          if (a[i][j] == '.') {
            cout << i + 1 << " " << j + 1 << endl;
            break;
          }
        } else if (a[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  }
}
