#include <bits/stdc++.h>
using namespace std;
string arr[1000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  bool row_check = 0;
  bool col_check = 0;
  for (int i = 0; i < n; i++) {
    row_check = 0;
    for (int j = 0; j < n; j++) {
      row_check |= arr[i][j] == '.';
    }
    if (!row_check) break;
  }
  for (int i = 0; i < n; i++) {
    col_check = 0;
    for (int j = 0; j < n; j++) {
      col_check |= arr[j][i] == '.';
    }
    if (!col_check) break;
  }
  if (!col_check && !row_check) {
    cout << -1;
  } else if (row_check) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (arr[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << "\n";
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (arr[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
