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