#include <bits/stdc++.h>
using namespace std;
int n;
char s[110][110];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) scanf("%s", s[i]);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      int tag = 1;
      for (int j = 0; j < n; j++) {
        if (s[i][j] == '.') {
          tag = 0;
          break;
        }
      }
      cnt += (tag == 0);
    }
    if (cnt == n) {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if (s[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
        }
      }
    } else {
      cnt = 0;
      for (int i = 0; i < n; i++) {
        int tag = 0;
        for (int j = 0; j < n; j++) {
          if (s[j][i] == '.') {
            tag = 1;
            break;
          }
        }
        cnt += tag;
      }
      if (cnt == n) {
        for (int j = 0; j < n; j++) {
          for (int i = 0; i < n; i++) {
            if (s[i][j] == '.') {
              printf("%d %d\n", i + 1, j + 1);
              break;
            }
          }
        }
      } else {
        printf("-1\n");
      }
    }
  }
}
