#include <bits/stdc++.h>
using namespace std;
char grid[102][102];
int row[102], col[102], x[102], y[102];
int main() {
  int n, i, j, r = 0, c = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", grid[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (grid[i][j] == '.') {
        row[i] = 1;
        col[j] = 1;
        y[i + 1] = j + 1;
        x[j + 1] = i + 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    r += row[i];
    c += col[i];
  }
  if (r != n && c != n)
    printf("-1\n");
  else if (r == n) {
    for (i = 1; i <= n; i++) {
      printf("%d %d\n", i, y[i]);
    }
  } else {
    for (i = 1; i <= n; i++) {
      printf("%d %d\n", x[i], i);
    }
  }
  return 0;
}
