#include <bits/stdc++.h>
int main() {
  int n, i, j, count1, count2, b[100];
  char a[100][100];
  while (~scanf("%d", &n)) {
    getchar();
    memset(b, 0, sizeof(b));
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) scanf("%c", &a[i][j]);
      getchar();
    }
    count1 = 0;
    count2 = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++)
        if (a[i][j] == '.') break;
      if (j == n) break;
    }
    if (i != n) {
      count1++;
    }
    for (j = 0; j < n; j++) {
      for (i = 0; i < n; i++)
        if (a[i][j] == '.') break;
      if (i == n) break;
    }
    if (j != n) {
      count2++;
    }
    if (count1 + count2 == 2) {
      printf("-1\n");
      continue;
    }
    if (count2 == 1 || count2 == 0 && count1 == 0) {
      for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
          if (!b[i] && a[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            b[i] = 1;
            break;
          }
        }
      }
    } else {
      if (count1 == 1 || count2 == 0 && count1 == 0) {
        for (j = 0; j < n; j++) {
          for (i = 0; i < n; i++) {
            if (!b[j] && a[i][j] == '.') {
              printf("%d %d\n", i + 1, j + 1);
              b[j] = 1;
              break;
            }
          }
        }
      }
    }
  }
  return 0;
}
