#include <bits/stdc++.h>
using namespace std;
char a[105][105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[j][i];
  bool cfull = false, rfull = false;
  for (int i = 0; i < n; i++) {
    bool b1 = true, b2 = true;
    for (int j = 0; j < n; j++) {
      if (a[j][i] == '.') b1 = false;
      if (a[i][j] == '.') b2 = false;
    }
    if (b1) rfull = true;
    if (b2) cfull = true;
  }
  if (cfull && rfull) {
    cout << -1 << endl;
    return 0;
  }
  if (cfull || rfull) {
    if (rfull) {
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++) {
          if (a[i][j] == '.') {
            cout << j + 1 << ' ' << i + 1 << endl;
            break;
          }
        }
    } else {
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++) {
          if (a[j][i] == '.') {
            cout << i + 1 << ' ' << j + 1 << endl;
            break;
          }
        }
    }
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (a[j][i] == '.') {
        cout << i + 1 << ' ' << j + 1 << endl;
        break;
      }
  }
  return 0;
}
