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