#include <bits/stdc++.h>
int n;
char a[128][128];
char b[128][128];
int row[128], col[128];
int main() {
  for (int i = 0; i < 128; ++i) {
    row[i] = -1;
    col[i] = -1;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("\n");
    for (int j = 0; j < n; ++j) {
      scanf("%c", &a[i][j]);
      if (a[i][j] == '.') {
        row[i] = j;
        col[j] = i;
      }
    }
  }
  int rows = 0, cols = 0;
  for (int i = 0; i < n; ++i) {
    rows += row[i] != -1;
    cols += col[i] != -1;
  }
  if (rows < n && cols < n) {
    printf("-1\n");
    return 0;
  }
  if (rows == n)
    for (int i = 0; i < n; ++i) printf("%d %d\n", i + 1, row[i] + 1);
  else
    for (int i = 0; i < n; ++i) printf("%d %d\n", col[i] + 1, i + 1);
  return 0;
}
