#include <bits/stdc++.h>
using namespace std;
char a[109][109];
struct arr {
  int val, x, y;
} b[109], c[109];
int main() {
  int n, i, j, t1, t2;
  char cc;
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> cc;
      a[i][j] = (cc == '.') ? 1 : 0;
    }
  }
  t1 = 0, t2 = 0;
  bool f1, f2;
  for (i = 0; i < n; i++) {
    f1 = 0;
    f2 = 0;
    for (j = 0; j < n; j++) {
      if (a[i][j] == 1 && !f1) {
        t1++;
        b[i].val = 1;
        b[i].x = i;
        b[i].y = j;
        f1 = 1;
      }
      if (a[j][i] == 1 && !f2) {
        t2++;
        c[i].val = 1;
        c[i].x = j;
        c[i].y = i;
        f2 = 1;
      }
    }
  }
  if (t1 == n) {
    for (i = 0; i < n; i++) {
      cout << b[i].x + 1 << " " << b[i].y + 1 << endl;
    }
  } else if (t2 == n) {
    for (i = 0; i < n; i++) {
      cout << c[i].x + 1 << " " << c[i].y + 1 << endl;
    }
  } else {
    cout << "-1";
  }
}
