#include <bits/stdc++.h>
using namespace std;
int main() {
  int nin, inum;
  int x, y, z, i, j, k, n;
  nin = 1;
  for (((inum) = (0)); ((inum) < (nin)); ((inum) += (1))) {
    cin >> n;
    int m = n;
    char r[n + 1][n + 1];
    for (((i) = (0)); ((i) < (n)); ((i) += (1))) cin >> r[i];
    int cn;
    int mode = 0;
    int p1 = 0;
    for (((i) = (0)); ((i) < (n)); ((i) += (1))) {
      cn = 0;
      for (((j) = (0)); ((j) < (m)); ((j) += (1))) {
        if (r[i][j] == 'E') cn++;
      }
      if (cn == n) p1 |= 1;
    }
    for (((j) = (0)); ((j) < (n)); ((j) += (1))) {
      cn = 0;
      for (((i) = (0)); ((i) < (m)); ((i) += (1))) {
        if (r[i][j] == 'E') cn++;
      }
      if (cn == n) p1 |= 2;
    }
    if (p1 == 3)
      cout << -1;
    else if (p1 == 2) {
      for (((i) = (0)); ((i) < (n)); ((i) += (1))) {
        cn = 0;
        for (((j) = (0)); ((j) < (m)); ((j) += (1))) {
          if (r[i][j] == 'E')
            ;
          else {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
        }
      }
    } else {
      for (((j) = (0)); ((j) < (n)); ((j) += (1))) {
        for (((i) = (0)); ((i) < (m)); ((i) += (1))) {
          if (r[i][j] == 'E')
            ;
          else {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
        }
      }
    }
  }
  return 0;
}
