#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m;
  cin >> n;
  char a[n][n];
  int vis[n];
  memset(vis, 0, sizeof(vis));
  bool glaf = 0;
  vector<int> kd;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (i == j && a[i][j] == 'E') {
        vis[i] = 1;
        glaf = 1;
        kd.push_back(i);
      }
    }
  }
  vector<pair<int, int> > ra;
  if (glaf == 0) {
    for (int i = 1; i <= n; i++) {
      cout << i << " " << i << endl;
    }
    return;
  } else {
    bool flag = 0, glaf = 0;
    for (int i = 0; i < n; i++) {
      if (vis[i] == 1) {
        flag = 0;
        for (int j = 0; j < n; j++) {
          if (a[i][j] == '.') {
            ra.push_back({i + 1, j + 1});
            flag = 1;
            break;
          }
        }
        if (flag == 0) {
          break;
        }
      }
    }
    if (flag) {
      for (int i = 0; i < ra.size(); i++) {
        cout << ra[i].first << " " << ra[i].second << endl;
      }
      for (int i = 0; i < n; i++) {
        if (a[i][i] == '.') {
          cout << i + 1 << " " << i + 1 << endl;
        }
      }
      return;
    } else {
      ra.clear();
      bool flag = 0;
      for (int i = 0; i < n; i++) {
        if (vis[i] == 1) {
          flag = 0;
          for (int j = 0; j < n; j++) {
            if (a[j][i] == '.') {
              ra.push_back({j + 1, i + 1});
              flag = 1;
              break;
            }
          }
          if (flag == 0) {
            break;
          }
        }
      }
      if (flag) {
        for (int i = 0; i < ra.size(); i++) {
          cout << ra[i].first << " " << ra[i].second << endl;
        }
        for (int i = 0; i < n; i++) {
          if (a[i][i] == '.') {
            cout << i + 1 << " " << i + 1 << endl;
          }
        }
      } else {
        cout << "-1";
        return;
      }
    }
  }
}
int main() {
  int t = 1;
  while (t--) solve();
}
