#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  char ch[n][n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cin >> ch[i][j];
  }
  vector<pair<long long, long long> > ans;
  long long check = 1;
  for (long long i = 0; i < n; i++) {
    long long flag = 1;
    for (long long j = 0; j < n; j++) {
      if (ch[i][j] == '.') {
        ans.push_back({i + 1, j + 1});
        flag = 0;
        break;
      }
    }
    if (flag) {
      check = 0;
      break;
    }
  }
  if (check == 1) {
    for (long long i = 0; i < n; i++)
      cout << ans[i].first << " " << ans[i].second << '\n';
    return 0;
  }
  ans.clear();
  check = 1;
  for (long long i = 0; i < n; i++) {
    long long flag = 1;
    for (long long j = 0; j < n; j++) {
      if (ch[j][i] == '.') {
        ans.push_back({j + 1, i + 1});
        flag = 0;
        break;
      }
    }
    if (flag) {
      check = 0;
      break;
    }
  }
  if (check == 1) {
    for (long long i = 0; i < n; i++)
      cout << ans[i].first << " " << ans[i].second << '\n';
    return 0;
  }
  cout << -1;
  return 0;
}
