#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  char a[n][n];
  string s;
  vector<bool> rows(n, true);
  vector<bool> cols(n, true);
  int q = 0;
  int w = 0;
  getline(cin, s, char(10));
  for (int i = 0; i < n; i++) {
    getline(cin, s, char(10));
    for (int j = 0; j < n; j++) {
      a[i][j] = s[j];
      if (s[j] == '.') {
        rows[i] = false;
        cols[j] = false;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if ((rows[i]) && (cols[j])) {
        cout << -1;
        return 0;
      }
    }
  bool f = true;
  for (int i = 0; i < n; i++)
    if (rows[i]) f = false;
  if (f) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if ((a[i][j] == '.') && (!(rows[i]))) {
          cout << i + 1 << ' ' << j + 1 << endl;
          rows[i] = true;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if ((a[i][j] == '.') && (!(cols[j]))) {
          cout << i + 1 << ' ' << j + 1 << endl;
          cols[j] = true;
        }
      }
    }
  }
}
