#include <bits/stdc++.h>
using namespace std;
const int N = 111;
int c[N], r[N];
char ch[N];
int main() {
  int n, i, j;
  while (cin >> n) {
    memset(c, 0, sizeof(c));
    memset(r, 0, sizeof(r));
    for (i = 1; i <= n; i++) {
      cin >> ch;
      for (j = 0; j < n; j++) {
        if (ch[j] == '.') {
          c[i] = j + 1;
          r[j + 1] = i;
        }
      }
    }
    int fc = 1, fr = 1;
    for (i = 1; i <= n; i++) {
      if (!c[i]) fc = 0;
      if (!r[i]) fr = 0;
    }
    if (fc) {
      for (i = 1; i <= n; i++) {
        cout << i << " " << c[i] << endl;
      }
    } else if (fr) {
      for (i = 1; i <= n; i++) {
        cout << r[i] << " " << i << endl;
      }
    } else if (!fr && !fc) {
      cout << "-1" << endl;
    }
  }
}
