#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
char a[MAXN][MAXN];
int cntR[MAXN];
int cntC[MAXN];
int N;
int main(void) {
  cin >> N;
  getchar();
  fill(cntR, cntR + MAXN, 0);
  fill(cntC, cntC + MAXN, 0);
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      a[i][j] = getchar();
      if (a[i][j] == '.') {
        cntR[i]++;
        cntC[j]++;
      }
    }
    getchar();
  }
  if (count(cntR + 1, cntR + 1 + N, 0) > 0 &&
      count(cntC + 1, cntC + 1 + N, 0) > 0) {
    cout << -1 << endl;
    return 0;
  }
  if (count(cntR + 1, cntR + 1 + N, 0) == 0) {
    for (int i = 1; i <= N; i++) {
      for (int j = 1; j <= N; j++)
        if (a[i][j] == '.') {
          cout << i << ' ' << j << endl;
          break;
        }
    }
  } else {
    for (int i = 1; i <= N; i++) {
      for (int j = 1; j <= N; j++)
        if (a[j][i] == '.') {
          cout << j << ' ' << i << endl;
          break;
        }
    }
  }
  return 0;
}
