#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 + 2;
int a[MAX_N][MAX_N];
int n;
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      char ch;
      cin >> ch;
      a[i][j] = (ch == '.');
    }
  for (int i = 0; i < n; ++i) {
    int k = -1;
    for (int j = 0; j < n; ++j)
      if (a[i][j]) {
        k = j;
        break;
      }
    if (k != -1) ans.push_back(make_pair(i, k));
  }
  if (ans.size() == n) {
    for (int i = 0; i < n; ++i)
      cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << endl;
    return 0;
  }
  ans.clear();
  for (int j = 0; j < n; ++j) {
    int k = -1;
    for (int i = 0; i < n; ++i)
      if (a[i][j]) {
        k = i;
        break;
      }
    if (k != -1) ans.push_back(make_pair(k, j));
  }
  if (ans.size() == n) {
    for (int i = 0; i < n; ++i)
      cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << endl;
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
