#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[100][100];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  int flag = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 'E') count++;
    }
    if (count == n) {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    flag = 0;
    for (int i = 0; i < n; i++) {
      int count = 0;
      for (int j = 0; j < n; j++) {
        if (a[j][i] == 'E') count++;
      }
      if (count == n) flag = 1;
    }
    if (flag == 1) {
      cout << "-1" << endl;
      return 0;
    } else {
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if (a[j][i] == '.') {
            cout << j + 1 << " " << i + 1 << endl;
            break;
          }
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (a[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  }
  return 0;
}
