#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n + 1][n + 1];
  int r[n + 1], c[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    r[i] = 0;
    c[i] = 0;
  }
  int cflag = 1, rflag = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        r[i] = 1;
        c[j] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (r[i] == 0) {
      rflag = 0;
    }
    if (c[i] == 0) {
      cflag = 0;
    }
  }
  if (!cflag && !rflag) {
    cout << "-1" << endl;
  } else if (!cflag) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (s[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (s[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  }
  return 0;
}
