#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
void solve() {
  long long n;
  cin >> n;
  vector<string> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  bool x = false, y = false;
  for (long long i = 0; i < n; i++) {
    bool ch = true;
    for (auto x : v[i])
      if (x == '.') ch = false;
    if (ch) {
      x = true;
    }
  }
  for (long long i = 0; i < n; i++) {
    bool ch = true;
    for (long long j = 0; j < n; j++) {
      if (v[j][i] == '.') ch = false;
    }
    if (ch) {
      y = true;
    }
  }
  if (x & y) {
    cout << -1 << '\n';
    return;
  }
  vector<pair<long long, long long>> ans;
  if (!x)
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (v[i][j] == '.') {
          ans.push_back({i, j});
          break;
        }
      }
    }
  else {
    for (long long j = 0; j < n; j++) {
      for (long long i = 0; i < n; i++) {
        if (v[i][j] == '.') {
          ans.push_back({i, j});
          break;
        }
      }
    }
  }
  for (auto x : ans) cout << x.first + 1 << " " << x.second + 1 << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) solve();
  return 0;
}
