#include <bits/stdc++.h>
using namespace std;
void hehe() {
  int n;
  cin >> n;
  vector<pair<int, int>> ans;
  vector<string> str(n);
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == '.') {
        ans.push_back({i, j});
        break;
      }
    }
  }
  if (ans.size() != n) {
    ans.clear();
    for (int j = 0; j < n; j++) {
      for (int i = 0; i < n; i++) {
        if (str[i][j] == '.') {
          ans.push_back({i, j});
          break;
        }
      }
    }
  }
  if (ans.size() != n) {
    cout << -1;
    return;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i].first + 1 << " " << ans[i].second + 1 << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    hehe();
  }
  return 0;
}
