#include <bits/stdc++.h>
using namespace std;
int x[105] = {0}, y[105] = {0};
int main() {
  int n;
  cin >> n;
  int cnt1 = 0, cnt2 = 0;
  char ch;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> ch;
      if (ch == '.') {
        if (!x[i]) x[i] = j, cnt1++;
        if (!y[j]) y[j] = i, cnt2++;
      }
    }
  }
  if (cnt1 == n)
    for (int i = 1; i <= n; i++) cout << i << " " << x[i] << "\n";
  else if (cnt2 == n)
    for (int i = 1; i <= n; i++) cout << y[i] << " " << i << "\n";
  else
    cout << "-1\n";
}
