#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << "\n";
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << "\n";
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << "\n";
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << "\n";
}
int arr[110][110];
char getmychar() {
  char ch;
  ch = getchar();
  if (ch == '.' or ch == 'E') return ch;
  return getmychar();
}
int main() {
  int n;
  scanf("%d", &n);
  memset(arr, 0, sizeof arr);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) arr[i][j] = (getmychar() == 'E') ? 1 : 0;
  vector<pair<int, int> > points;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (!arr[i][j]) {
        points.push_back(make_pair(i + 1, j + 1));
        break;
      }
    }
  }
  if (points.size() != n) {
    points.clear();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (!arr[j][i]) {
          points.push_back(make_pair(j + 1, i + 1));
          break;
        }
      }
    }
  }
  if (points.size() != n)
    printf("%d\n", -1);
  else {
    for (int i = 0; i < points.size(); i++) {
      printf("%d %d\n", points[i].first, points[i].second);
    }
  }
  return 0;
}
