#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> grid(n);
  for (int i = 0; i < n; i++) {
    cin >> grid[i];
  }
  bool rowOrderPossible = true;
  for (int i = 0; i < n; i++) {
    bool ok = false;
    for (int j = 0; j < n; j++) {
      if (grid[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (!ok) {
      rowOrderPossible = false;
      break;
    }
  }
  if (rowOrderPossible) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (grid[i][j] == '.') {
          cout << (i + 1) << " " << (j + 1) << endl;
          break;
        }
      }
    }
    return 0;
  }
  bool columnOrderPossible = true;
  for (int j = 0; j < n; j++) {
    bool ok = false;
    for (int i = 0; i < n; i++) {
      if (grid[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (!ok) {
      columnOrderPossible = false;
      break;
    }
  }
  if (columnOrderPossible) {
    for (int j = 0; j < n; j++) {
      for (int i = 0; i < n; i++) {
        if (grid[i][j] == '.') {
          cout << (i + 1) << " " << (j + 1) << endl;
          break;
        }
      }
    }
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
