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