#include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed;
  cout.precision(10);
  int n;
  cin >> n;
  char c[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> c[i][j];
    }
  }
  vector<pi> u, v;
  for (int i = 0; i < n; i++) {
    bool a = 1, b = 1;
    for (int j = 0; j < n; j++) {
      if (a and c[i][j] == '.') {
        u.push_back({i + 1, j + 1});
        a = 0;
      }
      if (b and c[j][i] == '.') {
        v.push_back({j + 1, i + 1});
        b = 0;
      }
    }
  }
  if ((int)u.size() != n and (int) v.size() != n) {
    cout << "-1\n";
  } else {
    if ((int)u.size() == n) {
      for (auto i : u) {
        cout << i.first << " " << i.second << "\n";
      }
    } else {
      for (auto i : v) {
        cout << i.first << " " << i.second << "\n";
      }
    }
  }
  return 0;
}
