#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e5 + 5;
const int MOD = 1e9 + 7;
const int BASE = 31;
char z[150][150];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      cin >> z[i][j];
    }
  bool good = true;
  for (int i = 0; i < n; ++i) {
    bool check = false;
    for (int j = 0; j < n; ++j) {
      if (z[i][j] == '.') check = true;
    }
    if (!check) good = false;
  }
  if (good) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (z[i][j] == '.') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
    return 0;
  }
  good = true;
  for (int i = 0; i < n; ++i) {
    bool check = false;
    for (int j = 0; j < n; ++j) {
      if (z[j][i] == '.') check = true;
    }
    if (!check) good = false;
  }
  if (good) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (z[j][i] == '.') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
