#include <bits/stdc++.h>
using namespace std;
const int N = 107;
const int start = 1;
int n, cnt;
char s[N][N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + start);
    int t = 0;
    for (int j = 1; j <= n; j++) {
      if (s[i][j] == '.') {
        t = 1;
        break;
      }
    }
    if (t == 0) {
      cnt = 1;
    }
  }
  for (int j = 1; j <= n; j++) {
    int t = 0;
    for (int i = 1; i <= n; i++) {
      if (s[i][j] == '.') {
        t = 1;
        break;
      }
    }
    if (t == 0 && cnt < 1000) {
      cnt += 1000;
      break;
    }
  }
  if (cnt == 1001) {
    printf("-1");
    return 0;
  }
  if (cnt == 1000) {
    for (int i = 1; i <= n; i++) {
      int t = 0;
      for (int j = 1; j <= n; j++) {
        if (s[i][j] == '.') {
          t = 1;
          printf("%d %d\n", i, j);
          break;
        }
      }
    }
  } else {
    for (int j = 1; j <= n; j++) {
      int t = 0;
      for (int i = 1; i <= n; i++) {
        if (s[i][j] == '.') {
          t = 1;
          printf("%d %d\n", i, j);
          break;
        }
      }
    }
  }
  return 0;
}
