#include <bits/stdc++.h>
using namespace std;
int n, a[101], b[101];
char s[101][101];
int ans, ans2;
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 h = 1; h <= n; h++) {
      cin >> s[i][h];
      if (s[i][h] == '.') {
        a[i]++;
        b[h]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] > 0) {
      ans++;
    }
    if (b[i] > 0) {
      ans2++;
    }
  }
  if (ans == n) {
    for (int i = 1; i <= n; i++) {
      for (int h = 1; h <= n; h++) {
        if (s[i][h] == '.') {
          cout << i << ' ' << h << endl;
          break;
        }
      }
    }
    return 0;
  } else if (ans2 == n) {
    for (int i = 1; i <= n; i++) {
      for (int h = 1; h <= n; h++) {
        if (s[h][i] == '.') {
          cout << h << ' ' << i << endl;
          break;
        }
      }
    }
    return 0;
  } else
    cout << -1;
}
