#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[150][150] = {};
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  bool str = true, stl = true;
  for (int i = 0; i < n; i++) {
    bool f = false;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == '.') {
        f = true;
      }
    }
    if (!f) {
      str = false;
    }
  }
  for (int j = 0; j < n; j++) {
    bool f = false;
    for (int i = 0; i < n; i++) {
      if (a[i][j] == '.') {
        f = true;
      }
    }
    if (!f) {
      stl = false;
    }
  }
  if (!stl && !str) {
    cout << -1;
    exit(0);
  }
  if (str) {
    for (int i = 0; i < n; i++) {
      int j = 0;
      while (a[i][j] != '.') j++;
      cout << i + 1 << " " << j + 1 << endl;
    }
  } else {
    for (int j = 0; j < n; j++) {
      int i = 0;
      while (a[i][j] != '.') i++;
      cout << i + 1 << " " << j + 1 << endl;
    }
  }
  return 0;
}
