#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  bool Row[101] = {true}, Column[101] = {true}, R = true, C = true;
  int n;
  string s;
  cin >> n;
  vector<pair<int, int>> Pos_C[101], Pos_R[101];
  for (long long i = 0; i < (long long)n; i++) {
    cin >> s;
    for (long long j = 0; j < (long long)n; j++) {
      if (s[j] == '.') {
        Row[i + 1] = true;
        Column[j + 1] = true;
        Pos_C[j + 1].push_back(make_pair(i + 1, j + 1));
        Pos_R[i + 1].push_back(make_pair(i + 1, j + 1));
      }
    }
  }
  for (long long i = 0; i < (long long)n; i++) {
    if (!Row[i + 1]) R = false;
    if (!Column[i + 1]) C = false;
  }
  if (R) {
    for (long long i = 0; i < (long long)n; i++) {
      cout << Pos_R[i + 1][0].first << " " << Pos_R[i + 1][0].second << endl;
    }
  } else if (C) {
    for (long long i = 0; i < (long long)n; i++) {
      cout << Pos_C[i + 1][0].first << " " << Pos_C[i + 1][0].second << endl;
    }
  } else
    cout << -1;
  return 0;
}
