#include <bits/stdc++.h>
using namespace std;
char c[128][128];
bool ux[128], uy[128];
vector<pair<int, int> > vx;
vector<pair<int, int> > vy;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> c[i][j];
      if (c[i][j] == '.') {
        if (!ux[i]) {
          ux[i] = 1;
          vx.push_back(make_pair(i, j));
        }
        if (!uy[j]) {
          uy[j] = 1;
          vy.push_back(make_pair(i, j));
        }
      }
    }
  if (vx.size() < n && vy.size() < n) {
    cout << -1 << endl;
    return 0;
  }
  if (vx.size() == n) {
    for (int i = 0; i < n; i++)
      cout << vx[i].first << ' ' << vx[i].second << endl;
    return 0;
  }
  for (int i = 0; i < n; i++)
    cout << vy[i].first << ' ' << vy[i].second << endl;
  return 0;
}
