#include <bits/stdc++.h>
using namespace std;
const int MAXN = 128;
char s[MAXN][MAXN];
bool c[MAXN], r[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s[i]);
    for (int j = 0; j < n; ++j)
      if (s[i][j] == '.') {
        r[i] = true, c[j] = true;
      }
  }
  bool ok = true;
  for (int i = 0; i < n; ++i) ok = ok && r[i];
  if (ok) {
    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;
        }
    }
    return 0;
  }
  ok = true;
  for (int i = 0; i < n; ++i) ok = ok && c[i];
  if (ok) {
    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;
        }
    }
    return 0;
  }
  puts("-1");
  return 0;
}
