#include <bits/stdc++.h>
using namespace std;
char arr[105][105];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  int r = 0, c = 0;
  for (int i = 0; i < n; i++) {
    r = 1;
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == '.') r = 0;
    }
    if (r == 1) break;
  }
  for (int j = 0; j < n; j++) {
    c = 1;
    for (int i = 0; i < n; i++) {
      if (arr[i][j] == '.') c = 0;
    }
    if (c == 1) break;
  }
  if (r == 1 && c == 1) {
    printf("-1\n");
    exit(0);
  }
  if (r == 1) {
    for (int j = 0; j < n; j++) {
      for (int i = 0; i < n; i++) {
        if (arr[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (arr[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
      }
    }
  }
  return 0;
}
