#include <bits/stdc++.h>
using namespace std;
char str[110][110];
int v[110][110];
int x[110], y[110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%s", str[i] + 1);
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      bool is = false;
      for (int k = 1; k <= n; k++)
        if (str[i][k] == '.') is = true;
      for (int k = 1; k <= n; k++)
        if (str[k][j] == '.') is = true;
      if (!is) flag = false;
    }
  }
  if (!flag)
    printf("-1\n");
  else {
    bool t = false;
    int h;
    for (int i = 1; i <= n; i++) {
      bool is = true;
      for (int j = 1; j <= n; j++)
        if (str[i][j] == '.') is = false;
      if (is) {
        h = i;
        t = true;
        break;
      }
    }
    if (t) {
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
          if (str[j][i] == '.') {
            printf("%d %d\n", j, i);
            break;
          }
        }
      }
    } else {
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
          if (str[i][j] == '.') {
            printf("%d %d\n", i, j);
            break;
          }
        }
      }
    }
  }
  return 0;
}
