#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char c;
  while (~scanf("%d", &n)) {
    int a[(1000 + 10)] = {0}, d[(1000 + 10)] = {0};
    bool b[(1000 + 10)][(1000 + 10)] = {0};
    getchar();
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        scanf("%c", &c);
        if (c == '.')
          b[i][j] = 1, a[i] = j, d[j] = i;
        else if (c == 'E')
          b[i][j] = 0;
      }
      getchar();
    }
    bool jug = 0;
    for (int i = 1; i <= n; i++)
      if (!a[i]) jug = 1;
    if (!jug) {
      for (int i = 1; i <= n; i++) printf("%d %d\n", i, a[i]);
      continue;
    }
    jug = 0;
    for (int i = 1; i <= n; i++)
      if (!d[i]) jug = 1;
    if (!jug) {
      for (int i = 1; i <= n; i++) printf("%d %d\n", d[i], i);
      continue;
    }
    puts("-1");
  }
  return 0;
}
