#include <bits/stdc++.h>
using namespace std;
long n, m;
char a[10001][10001];
long b[1001][101] = {0}, c[101][101] = {0};
bool used[1001] = {0};
void dl() {
  for (int k = 1; k <= n; k) {
    for (int i = 1; i <= n; ++i)
      if (a[k][i] == '.') {
        cout << k << ' ' << i << endl;
        break;
      }
    ++k;
  }
}
void dr() {
  for (int k = 1; k <= n; k) {
    for (int i = 1; i <= n; ++i)
      if (a[i][k] == '.') {
        cout << i << ' ' << k << endl;
        break;
      }
    ++k;
  }
}
int main() {
  cin >> n;
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i) {
      cin >> a[k][i];
      if (a[k][i] == '.') {
        b[k][i] = b[k][i - 1] + 1;
      } else
        b[k][i] = b[k][i - 1];
    }
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      if (a[i][k] == '.')
        c[i][k] = c[i - 1][k] + 1;
      else
        c[i][k] = c[i - 1][k];
  long s = 0, s1 = 0;
  for (int k = 1; k <= n; ++k) {
    if (c[n][k] > 0) ++s1;
    if (b[k][n] > 0) ++s;
  }
  if (s == n) {
    dl();
    return 0;
  }
  if (s1 == n) {
    dr();
    return 0;
  }
  cout << -1;
}
