#include <bits/stdc++.h>
using namespace std;
int mark[100 + 10], mark_r[100 + 10];
bool rows_fail, columns_fail;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t_1 = 101;
    for (int j = 0; j < n; j++) {
      char s;
      cin >> s;
      if (s == '.') {
        t_1 = j;
        mark[j] = i + 1;
      }
    }
    if (t_1 == 101)
      rows_fail = true;
    else {
      mark_r[i] = t_1 + 1;
    }
  }
  for (int i = 0; i < n; i++)
    if (!mark[i]) columns_fail = true;
  if (!rows_fail) {
    for (int i = 0; i < n; i++) {
      cout << i + 1 << ' ' << mark_r[i] << endl;
    }
    return 0;
  }
  if (!columns_fail) {
    for (int i = 0; i < n; i++) {
      cout << mark[i] << ' ' << i + 1 << endl;
    }
    return 0;
  }
  cout << -1 << '\n';
  return 0;
}
