#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:100000000")
int main() {
  int n;
  cin >> n;
  vector<string> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  bool f = 0;
  for (int i = 0; i < n; ++i) {
    bool g = 0;
    for (int j = 0; j < n; ++j) {
      if (a[i][j] == '.') g = 1;
    }
    if (!g) {
      f = 1;
    }
  }
  if (!f) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (a[i][j] == '.') {
          cout << i + 1 << ' ' << j + 1 << endl;
          break;
        }
      }
    }
    return 0;
  }
  f = 0;
  for (int i = 0; i < n; ++i) {
    bool g = 0;
    for (int j = 0; j < n; ++j) {
      if (a[j][i] == '.') g = 1;
    }
    if (!g) {
      f = 1;
    }
  }
  if (!f) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (a[j][i] == '.') {
          cout << j + 1 << ' ' << i + 1 << endl;
          break;
        }
      }
    }
    return 0;
  };
  cout << -1;
  return 0;
}
