#include <bits/stdc++.h>
using namespace std;
bool purify(const vector<string> &tiles, bool row) {
  int n = tiles.size();
  vector<int> pos;
  pos.resize(n);
  int i, j;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      char cc;
      if (row)
        cc = tiles[i][j];
      else
        cc = tiles[j][i];
      if (cc == '.') {
        pos[i] = j;
        break;
      }
    }
    if (j == n) return false;
  }
  for (i = 0; i < n; ++i) {
    if (row)
      cout << i + 1 << ' ' << pos[i] + 1 << endl;
    else
      cout << pos[i] + 1 << ' ' << i + 1 << endl;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<string> tiles;
  tiles.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> tiles[i];
  }
  if (purify(tiles, true)) return 0;
  if (purify(tiles, false)) return 0;
  cout << -1 << endl;
  return 0;
}
