#include <bits/stdc++.h>
using namespace std;
int p[105], q[105];
char s[105][105];
int main() {
  if (0)
    freopen(
        ""
        ".in",
        "r", stdin);
  if (0)
    freopen(
        ""
        ".out",
        "w", stdout);
  int i, j, k, _T;
  int n;
  while (~scanf("%d", &n)) {
    for (i = 0; i < n; i++) {
      p[i] = q[i] = 0;
      scanf("%s", s[i]);
    }
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++)
        if (s[i][j] != 'E') p[i]++, q[j]++;
    int fp = 1, fq = 1;
    for (i = 0; i < n; i++)
      if (p[i] == 0) fp = 0;
    for (i = 0; i < n; i++)
      if (q[i] == 0) fq = 0;
    if (fp) {
      for (i = 0; i < n; i++)
        for (j = 0; j < n; j++)
          if (s[i][j] != 'E') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
    } else if (fq) {
      for (i = 0; i < n; i++)
        for (j = 0; j < n; j++)
          if (s[j][i] != 'E') {
            printf("%d %d\n", j + 1, i + 1);
            break;
          }
    } else
      puts("-1");
  }
  return 0;
}
