#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t_c = 1;
  for (long long t = 1; t <= t_c; t++) {
    long long n;
    cin >> n;
    vector<vector<pair<long long, long long>>> rows(n + 1);
    vector<vector<pair<long long, long long>>> cols(n + 1);
    string str;
    for (long long i = 0; i < n; i++) {
      cin >> str;
      for (long long j = 0; j < n; j++) {
        if (str[j] == '.') {
          rows[i + 1].push_back(make_pair(i + 1, j + 1));
          cols[j + 1].push_back(make_pair(i + 1, j + 1));
        }
      }
    }
    bool fine_row = true;
    bool fine_col = true;
    bool done = false;
    for (long long i = 1; i <= n; i++) {
      if (rows[i].size() == 0) {
        fine_row = false;
        break;
      }
    }
    for (long long i = 1; i <= n; i++) {
      if (cols[i].size() == 0) {
        fine_col = false;
        break;
      }
    }
    if (fine_col) {
      for (long long i = 1; i <= n; i++) {
        cout << cols[i][0].first << " " << cols[i][0].second << endl;
      }
      done = true;
    }
    if ((!done) && fine_row) {
      for (long long i = 1; i <= n; i++) {
        cout << rows[i][0].first << " " << rows[i][0].second << endl;
      }
      done = true;
    }
    if (!done) {
      cout << "-1\n";
    }
  }
  return 0;
}
