#include <bits/stdc++.h>
char M[100][101];
int c[100], r[100];
int main(void) {
  int n, i, j;
  scanf("%d", &n);
  memset(c, -1, sizeof c);
  memset(r, -1, sizeof r);
  for (i = 0; i < n; i++) {
    scanf("%s", M[i]);
    for (j = 0; j < n; j++)
      if (M[i][j] == '.') {
        c[j] = i;
        r[i] = j;
      }
  }
  int ok = 1;
  for (j = 0; j < n; j++)
    if (c[j] == -1) ok = 0;
  if (!ok) {
    ok = 1;
    for (i = 0; i < n; i++)
      if (r[i] == -1) ok = 0;
    if (!ok)
      printf("-1\n");
    else
      for (i = 0; i < n; i++) printf("%d %d\n", i + 1, r[i] + 1);
  } else
    for (j = 0; j < n; j++) printf("%d %d\n", c[j] + 1, j + 1);
  return 0;
}
