#include <bits/stdc++.h>
using namespace std;
string mm[100];
int col[100], row[100];
int main() {
  int n;
  cin >> n;
  for (int i = 0, _n = n; i < _n; i++) {
    cin >> mm[i];
    for (int j = 0, _n = n; j < _n; j++)
      if (mm[i][j] == '.') {
        col[j] = i + 1;
        row[i] = j + 1;
      }
  }
  bool rr = true, cc = true;
  for (int i = 0, _n = n; i < _n; i++) {
    rr = rr && (row[i] > 0);
    cc = cc && (col[i] > 0);
  }
  if (!rr && !cc)
    cout << -1 << "\n";
  else if (rr)
    for (int i = 0, _n = n; i < _n; i++) cout << i + 1 << " " << row[i] << "\n";
  else
    for (int i = 0, _n = n; i < _n; i++) cout << col[i] << " " << i + 1 << "\n";
  return 0;
}
