#include <bits/stdc++.h>
using namespace std;
int main() {
  int ct, n;
  char m[105][105];
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> m[i][j];
  int nu = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ct = 0;
      for (int k = 0; k < n; k++)
        if (m[i][k] == '.') ct++;
      for (int k = 0; k < n; k++)
        if (m[k][j] == '.') ct++;
      if (ct == 0) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  int row = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (m[i][j] == '.') {
        row++;
        break;
      }
    }
  }
  if (row == n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (m[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (m[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  }
  return 0;
}
