#include <bits/stdc++.h>
using namespace std;
int n;
char mat[155][155];
int row[155], col[155];
bool used_r[155], used_c[155];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", mat[i]);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (mat[i][j] == 'E') {
        row[i]++;
        col[j]++;
      }
    }
  bool stuck_row = false, stuck_col = false;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (mat[i][j] == 'E') {
        if (row[i] == n && col[j] == n) {
          puts("-1");
          return 0;
        }
        if (row[i] == n) stuck_row = true;
        if (col[j] == n) stuck_col = true;
      }
  if (!stuck_row) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        if (mat[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
  } else {
    for (int j = 0; j < n; j++)
      for (int i = 0; i < n; i++)
        if (mat[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
  }
  return 0;
}
