#include <bits/stdc++.h>
using namespace std;
const int cmx = 1e5 + 5;
int n;
char a[200][200];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  bool fine1 = true, fine2 = true;
  for (int i = 1; i <= n; i++) {
    bool ok = false;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (!ok) {
      fine1 = false;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    bool ok = false;
    for (int j = 1; j <= n; j++) {
      if (a[j][i] == '.') {
        ok = true;
        break;
      }
    }
    if (!ok) {
      fine2 = false;
      break;
    }
  }
  if (fine1 == false and fine2 == false) {
    cout << -1 << '\n';
    return 0;
  }
  if (fine1) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (a[i][j] == '.') {
          cout << i << " " << j << "\n";
          break;
        }
      }
    }
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[j][i] == '.') {
        cout << j << " " << i << "\n";
        break;
      }
    }
  }
  return 0;
}
