#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  char s[102][102];
  int i, j;
  int f = 0;
  for (i = 0; i < n; i++) {
    scanf("%s", &s[i]);
    int ok = 0;
    for (j = 0; j < n; j++)
      if (s[i][j] == '.') ok = 1;
    if (ok == 0) f = 1;
  }
  if (f == 1) {
    int ff = 0;
    for (j = 0; j < n; j++) {
      int ok = 0;
      for (i = 0; i < n; i++)
        if (s[i][j] == '.') ok = 1;
      if (ok == 0) ff = 1;
    }
    if (ff == 1)
      printf("-1\n");
    else {
      for (j = 0; j < n; j++) {
        for (i = 0; i < n; i++)
          if (s[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
      }
    }
  } else {
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++)
        if (s[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    }
  }
  return 0;
}
