#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char ch[100][100];
  for (int i = 0; i != n; ++i) {
    for (int j = 0; j != n; ++j) {
      cin >> ch[i][j];
    }
  }
  int flag = 0;
  int sum = 0;
  for (int i = 0; i != n; ++i) {
    int rflag = 0;
    for (int j = 0; j != n; ++j) {
      if ('.' == ch[i][j]) {
        rflag = 1;
        break;
      }
    }
    if (rflag) ++sum;
  }
  if (n == sum) flag ^= 1;
  sum = 0;
  for (int j = 0; j != n; ++j) {
    int rflag = 0;
    for (int i = 0; i != n; ++i) {
      if ('.' == ch[i][j]) {
        rflag = 1;
        break;
      }
    }
    if (rflag) ++sum;
  }
  if (n == sum) flag ^= 2;
  if (flag & 1) {
    for (int i = 0; i != n; ++i) {
      for (int j = 0; j != n; ++j) {
        if ('.' == ch[i][j]) {
          cout << i + 1 << ' ' << j + 1 << endl;
          break;
        }
      }
    }
  } else if (flag & 2) {
    for (int j = 0; j != n; ++j) {
      for (int i = 0; i != n; ++i) {
        if ('.' == ch[i][j]) {
          cout << i + 1 << ' ' << j + 1 << endl;
          break;
        }
      }
    }
  } else
    cout << "-1" << endl;
}
