#include <bits/stdc++.h>
using namespace std;
char ch, c[200][200];
bool nEc[200], nEr[200], ok1, ok2;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%c", &ch);
    for (int j = 1; j <= n; ++j) {
      scanf("%c", &c[i][j]);
      if (c[i][j] == '.') {
        nEr[i] = 1;
        nEc[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (nEr[i] == 0) ok1 = 1;
    if (nEc[i] == 0) ok2 = 1;
  }
  if (ok1 == 1 && ok2 == 1) {
    printf("%d", -1);
    return 0;
  }
  if (ok2 == 1) {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        if (c[i][j] == '.') {
          printf("%d %d\n", i, j);
          break;
        }
  } else {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        if (c[j][i] == '.') {
          printf("%d %d\n", j, i);
          break;
        }
  }
  return 0;
}
