#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int V = 4e6;
int spf1[V];
void solve() {
  int n;
  cin >> n;
  vector<string> v{};
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
    v.push_back(t);
  }
  set<int> rows{};
  set<int> columns{};
  vector<pair<int, int>> moves{};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (v[i][j] == '.') {
        rows.insert(i);
        columns.insert(j);
        moves.push_back(make_pair(i, j));
      }
    }
  }
  if (rows.size() < n && columns.size() < n) {
    cout << -1 << "\n";
    return;
  } else if (rows.size() < n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < moves.size(); j++) {
        if (i == moves[j].second) {
          cout << moves[j].first + 1 << " " << moves[j].second + 1 << "\n";
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < moves.size(); j++) {
        if (i == moves[j].first) {
          cout << moves[j].first + 1 << " " << moves[j].second + 1 << "\n";
          break;
        }
      }
    }
  }
}
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
