#include <bits/stdc++.h>
using namespace std;
int n;
char mat[103][103];
vector<pair<int, int> > v1;
vector<pair<int, int> > v2;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  int b1 = false, b2 = false;
  for (int i = 0; i < n; i++) {
    bool b = true;
    for (int j = 0; j < n; j++) {
      if (mat[i][j] == '.') {
        b = false;
        break;
      }
    }
    if (b) {
      b1 = true;
      break;
    }
  }
  for (int j = 0; j < n; j++) {
    bool b = true;
    for (int i = 0; i < n; i++) {
      if (mat[i][j] == '.') {
        b = false;
        break;
      }
    }
    if (b) {
      b2 = true;
      break;
    }
  }
  if (b1 && b2) {
    cout << -1;
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (mat[i][j] == '.') {
          v1.push_back(pair<int, int>(i + 1, j + 1));
          break;
        }
      }
    }
    for (int j = 0; j < n; j++) {
      for (int i = 0; i < n; i++) {
        if (mat[i][j] == '.') {
          v2.push_back(pair<int, int>(i + 1, j + 1));
          break;
        }
      }
    }
    if (v1.size() == n) {
      for (int i = 0; i < v1.size(); i++) {
        cout << v1[i].first << ' ' << v1[i].second << endl;
      }
    } else if (v2.size() == n) {
      for (int i = 0; i < v2.size(); i++) {
        cout << v2[i].first << ' ' << v2[i].second << endl;
      }
    }
  }
}
