#include <bits/stdc++.h>
using namespace std;
int n, m;
char mp[120][120];
int o, oo, ans[120];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%s", &mp[i]);
  for (int i = 0; i < n; i++) {
    o = 0;
    for (int j = 0; j < n; j++)
      if (mp[i][j] == '.') o = 1;
    if (!o) break;
  }
  if (o) {
    for (int i = 0; i < n; i++) {
      oo = 0;
      for (int j = 0; j < n; j++)
        if (mp[i][j] == '.') {
          oo = 1;
          ans[i] = j;
          break;
        }
      if (oo == 0) {
        cout << -1 << endl;
        return 0;
      }
    }
    for (int i = 0; i < n; i++) cout << i + 1 << ' ' << ans[i] + 1 << endl;
    return 0;
  } else {
    for (int j = 0; j < n; j++) {
      oo = 0;
      for (int i = 0; i < n; i++)
        if (mp[i][j] == '.') {
          oo = 1;
          ans[j] = i;
          break;
        }
      if (oo == 0) {
        cout << -1 << endl;
        return 0;
      }
    }
    for (int j = 0; j < n; j++) cout << ans[j] + 1 << ' ' << j + 1 << endl;
    return 0;
  }
}
