#include <bits/stdc++.h>
using namespace std;
long long int ESP = 1e18;
long long int FCB = 1e9 + 7;
long long int dir[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n;
  cin >> n;
  char ch[n][n];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      cin >> ch[i][j];
    }
  }
  bool rr = 0, cc = 0;
  for (long long int i = 0; i < n; i++) {
    bool xx = 0;
    for (long long int j = 0; j < n; j++) {
      if (ch[i][j] == '.') xx = 1;
    }
    if (!xx) rr = 1;
  }
  if (!rr) {
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < n; j++) {
        if (ch[i][j] == '.') {
          cout << 1 + i << " " << 1 + j << "\n";
          break;
        }
      }
    }
    return 0;
  }
  for (long long int i = 0; i < n; i++) {
    bool xx = 0;
    for (long long int j = 0; j < n; j++) {
      if (ch[j][i] == '.') xx = 1;
    }
    if (!xx) cc = 1;
  }
  if (!cc) {
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < n; j++) {
        if (ch[j][i] == '.') {
          cout << 1 + j << " " << 1 + i << "\n";
          break;
        }
      }
    }
    return 0;
  }
  cout << "-1"
       << "\n";
  return 0;
}
