#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<string> m(n);
  for (int i = 0; i < n; ++i) cin >> m[i];
  vector<vector<int> > a(n, vector<int>(n, 0));
  bool poss = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (m[i][j] == 'E') {
        bool found = 0;
        for (int k = 0; k < n; ++k)
          if (m[k][j] == '.' || m[i][k] == '.') found = 1;
        if (!found) poss = 0;
      }
    }
  }
  if (!poss) {
    cout << "-1\n";
    return 0;
  }
  bool row = 1;
  vector<int> ans(n, 0);
  for (int i = 0; i < n; ++i) {
    bool found = 0;
    for (int j = 0; j < n; ++j) {
      if (m[i][j] == '.') {
        found = 1;
        ans[i] = j;
        break;
      }
    }
    if (!found) {
      row = 0;
      break;
    }
  }
  if (!row) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (m[j][i] == '.') {
          ans[i] = j;
          break;
        }
      }
    }
  }
  if (row) {
    for (int i = 0; i < n; ++i) {
      cout << i + 1 << " " << ans[i] + 1 << "\n";
    }
  } else {
    for (int i = 0; i < n; ++i) {
      cout << ans[i] + 1 << " " << i + 1 << "\n";
    }
  }
}
