#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1, maxn = 1000 + 10;
int n;
char c[maxn][maxn];
void setIO(string name) {}
int gI() {
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  int p = 0, flag = 1;
  if (c == '-') flag = -1, c = getchar();
  while (c >= '0' && c <= '9') p = p * 10 + c - '0', c = getchar();
  return p * flag;
}
int main() {
  setIO("test");
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%s", c[i]);
  bool flag = 1;
  for (int i = 0; i < n; ++i) {
    bool f2 = 0;
    for (int j = 0; j < n; ++j)
      if (c[i][j] == '.') {
        f2 = 1;
        break;
      }
    if (!f2) {
      flag = 0;
      break;
    }
  }
  if (flag) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j)
        if (c[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    }
    return 0;
  }
  flag = 1;
  for (int j = 0; j < n; ++j) {
    bool f2 = 0;
    for (int i = 0; i < n; ++i)
      if (c[i][j] == '.') {
        f2 = 1;
        break;
      }
    if (!f2) {
      flag = 0;
      break;
    }
  }
  if (flag) {
    for (int j = 0; j < n; ++j) {
      for (int i = 0; i < n; ++i)
        if (c[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    }
    return 0;
  }
  puts("-1");
  return 0;
}
