#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long mod = 1e9 + 9;
const int INF = 1e9;
const int MAX = 1e5 + 10, N = 1e7;
const int lim = 1 << 18;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  while (cin >> n) {
    vector<string> v(n);
    vector<bool> row(n, false), col(n, false);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      for (int j = 0; j < n; j++) {
        if (v[i][j] == '.') row[i] = 1, col[j] = 1;
      }
    }
    bool val = true;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (!row[i] && !col[j]) val = false;
      }
    }
    if (!val)
      cout << -1 << "\n";
    else {
      int mi = *min_element(row.begin(), row.end());
      if (mi == 1) {
        for (int i = 0; i < n; i++) {
          for (int j = 0; j < n; j++) {
            if (v[i][j] == '.') {
              cout << i + 1 << " " << j + 1 << "\n";
              break;
            }
          }
        }
      } else {
        for (int j = 0; j < n; j++) {
          for (int i = 0; i < n; i++) {
            if (v[i][j] == '.') {
              cout << i + 1 << " " << j + 1 << "\n";
              break;
            }
          }
        }
      }
    }
  }
  return 0;
}
