#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
char s[110][110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  int k = 0, kk = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        k++;
        break;
      }
    }
  }
  if (k == n) {
    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;
        }
      }
    return 0;
  }
  k = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (s[j][i] == '.') {
        k++;
        break;
      }
    }
  }
  if (k != n) {
    cout << -1 << endl;
    return 0;
  }
  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;
}
