#include <bits/stdc++.h>
using namespace std;
char m[200][200];
vector<pair<int, int> > resp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      char c;
      cin >> c;
      m[i][j] = c;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (m[i][j] == '.') {
        resp.push_back(make_pair(i + 1, j + 1));
        break;
      }
    }
  }
  if (resp.size() != n) {
    resp.clear();
    for (int j = 0; j < n; j++) {
      for (int i = 0; i < n; i++) {
        if (m[i][j] == '.') {
          resp.push_back(make_pair(i + 1, j + 1));
          break;
        }
      }
    }
  }
  if (resp.size() != n) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < resp.size(); i++)
    cout << resp[i].first << " " << resp[i].second << endl;
  return 0;
}
