#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int temple[100][100] = {0};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < n; j++) {
      if (s[j] == '.') {
        temple[i][j] = 1;
      }
    }
  }
  int rows = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) sum += temple[i][j];
    if (sum != 0) rows++;
  }
  int columns = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) sum += temple[j][i];
    if (sum != 0) columns++;
  }
  if (rows == n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (temple[i][j] == 1) {
          cout << i + 1 << ' ' << j + 1 << endl;
          break;
        }
      }
    }
  } else if (columns == n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (temple[j][i] == 1) {
          cout << j + 1 << ' ' << i + 1 << endl;
          break;
        }
      }
    }
  } else {
    cout << -1;
    return 0;
  }
}
