#include <bits/stdc++.h>
using namespace std;
int n;
int a[101][101];
int pure[101][101];
bool check() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1) continue;
      for (int k = 0; k < n; k++) {
        pure[i][k] = 1;
        pure[k][j] = 1;
      }
    }
  }
  bool ans = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (pure[i][j] == 0) {
        return false;
      }
  return true;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      char ch;
      cin >> ch;
      if (ch == '.')
        a[i][j] = 0;
      else
        a[i][j] = 1;
    }
  if (check() == false) {
    cout << -1 << endl;
    return 0;
  }
  memset(pure, 0, sizeof(pure));
  int cnt = 0;
  vector<pair<int, int> > p1, p2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 0) {
        p1.push_back(make_pair(i + 1, j + 1));
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j][i] == 0) {
        p2.push_back(make_pair(j + 1, i + 1));
        break;
      }
    }
  }
  if (p1.size() == n) {
    for (int i = 0; i < n; i++)
      cout << p1[i].first << " " << p1[i].second << endl;
  } else {
    for (int i = 0; i < n; i++)
      cout << p2[i].first << " " << p2[i].second << endl;
  }
  return 0;
}
