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