#include <bits/stdc++.h>
using namespace std;
struct timer {
  time_t start;
  timer() { start = clock(); }
  ~timer() {
    cerr << 1. * (clock() - start) / CLOCKS_PER_SEC << " secs" << endl;
  }
};
int n;
char c[110][110];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> c[i];
  vector<long long> ans;
  for (int i = 0; i < (n); i++) {
    int f = 0;
    for (int j = 0; j < (n); j++)
      if (c[i][j] == '.') {
        f = 1;
        ans.push_back(j);
        break;
      }
    if (!f) break;
  }
  if (((int)(ans).size()) == n) {
    for (int i = 0; i < (n); i++) cout << i + 1 << " " << ans[i] + 1 << endl;
    return 0;
  }
  ans.clear();
  for (int j = 0; j < (n); j++) {
    int f = 0;
    for (int i = 0; i < (n); i++)
      if (c[i][j] == '.') {
        f = 1;
        ans.push_back(i);
        break;
      }
    if (!f) break;
  }
  if (((int)(ans).size()) == n) {
    for (int i = 0; i < (n); i++) cout << ans[i] + 1 << " " << i + 1 << endl;
    return 0;
  }
  cout << -1;
}
