#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> moves;
bool a[100][100];
int N;
bool poss(bool r) {
  moves.clear();
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (a[i][j]) {
        if (j == N - 1) {
          return false;
        }
      } else {
        moves.push_back(pair<int, int>(i + 1, j + 1));
        break;
      }
    }
  }
  for (auto n : moves) {
    cout << (r ? n.second : n.first) << ' ' << (r ? n.first : n.second) << "\n";
  }
  return true;
};
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      char c;
      cin >> c;
      a[i][j] = c == 'E';
    }
  }
  if (not poss(false)) {
    for (int i = 0; i < N - 1; ++i) {
      for (int j = i + 1; j < N; ++j) {
        auto tmp = a[i][j];
        a[i][j] = a[j][i];
        a[j][i] = tmp;
      }
    }
    if (not poss(true)) {
      cout << -1;
    }
  }
};
