#include <bits/stdc++.h>
using namespace std;
string str[100 + 10];
int numx[100 + 10], numy[100 + 10];
int main() {
  memset(numx, -1, sizeof(numx));
  memset(numy, -1, sizeof(numy));
  int n, cx = 0, cy = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == '.') {
        numx[i] = j;
        numy[j] = i;
      }
    }
  }
  bool f = true;
  for (int i = 0; i < n; i++) {
    if (numx[i] == -1) {
      f = false;
      break;
    }
  }
  if (f) {
    for (int i = 0; i < n; i++) {
      cout << i + 1 << " " << numx[i] + 1 << endl;
    }
    return 0;
  }
  f = true;
  for (int i = 0; i < n; i++) {
    if (numy[i] == -1) {
      f = false;
      break;
    }
  }
  if (f) {
    for (int i = 0; i < n; i++) {
      cout << numy[i] + 1 << " " << i + 1 << endl;
    }
    return 0;
  }
  cout << "-1" << endl;
  return 0;
}
