#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k, m = 0, n, t, f = 0, x, z, y, p = 0, ans = 0,
                     mn = 10000000009, mx = 0;
  cin >> n;
  char s[109][109];
  map<long long, long long> row, col;
  vector<pair<long long, long long> > vr, vc;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> s[i][j];
      if (s[i][j] == '.') {
        row[i] = 1;
        col[j] = 1;
        vr.push_back(make_pair(i, j));
        vc.push_back(make_pair(j, i));
      }
    }
  }
  long long cnt1 = 0, cnt2 = 0;
  for (i = 1; i <= n; i++) {
    if (row[i]) cnt1++;
    if (col[i]) cnt2++;
  }
  if (cnt1 != n && cnt2 != n)
    cout << "-1";
  else {
    if (cnt1 == n) {
      sort(vr.begin(), vr.end());
      for (i = 0; i < vr.size(); i++) {
        if (!i) {
          cout << vr[i].first << " " << vr[i].second << "\n";
          continue;
        }
        if (vr[i].first == vr[i - 1].first) continue;
        cout << vr[i].first << " " << vr[i].second << "\n";
      }
    } else if (cnt2 == n) {
      sort(vc.begin(), vc.end());
      for (i = 0; i < vc.size(); i++) {
        if (!i) {
          cout << vc[i].second << " " << vc[i].first << "\n";
          continue;
        }
        if (vc[i].first == vc[i - 1].first) continue;
        cout << vc[i].second << " " << vc[i].first << "\n";
      }
    }
  }
  return 0;
}
