#include <bits/stdc++.h>
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
vector<ii> find(vector<int>& val, bool rev) {
  vector<ii> res;
  for (int i = 0; i < val.size(); i++) {
    if (val[i] == -1) return vector<ii>();
    if (rev)
      res.emplace_back(i, val[i]);
    else
      res.emplace_back(val[i], i);
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<string> board(n);
  vector<int> cell(n, -1);
  vector<int> rev(n, -1);
  for (int i = 0; i < n; i++) {
    cin >> board[i];
    for (int j = 0; j < n; j++) {
      if (board[i][j] == '.') {
        if (cell[j] == -1) cell[j] = i;
        if (rev[i] == -1) rev[i] = j;
      }
    }
  }
  vector<ii> a = find(cell, false);
  vector<ii> b = find(rev, true);
  if (!a.empty())
    for (auto& r : a) printf("%d %d\n", r.first + 1, r.second + 1);
  else if (!b.empty())
    for (auto& r : b) printf("%d %d\n", r.first + 1, r.second + 1);
  else
    printf("-1");
  return 0;
}
