#include <bits/stdc++.h>
using namespace std;
int N;
char a[101][101];
vector<int> rf[101];
vector<int> cf[101];
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      cin >> a[i][j];
      if (a[i][j] == '.') {
        rf[i].push_back(j);
        cf[j].push_back(i);
      }
    }
  }
  bool allr = false;
  bool allc = false;
  for (int i = 0; i < N; ++i) {
    if (rf[i].size() == 0) {
      allr = true;
    }
  }
  for (int i = 0; i < N; ++i) {
    if (cf[i].size() == 0) {
      allc = true;
    }
  }
  if (allr && allc) {
    cout << -1 << endl;
    return 0;
  }
  if (!allr) {
    for (int i = 0; i < N; ++i) {
      cout << i + 1 << " " << rf[i][0] + 1 << endl;
    }
  } else if (!allc) {
    for (int i = 0; i < N; ++i) {
      cout << cf[i][0] + 1 << " " << i + 1 << endl;
    }
  } else {
    cout << "GG" << endl;
    return 0;
  }
  return 0;
}
