#include <bits/stdc++.h>
using namespace std;
char a[101][101];
int s1[101], s2[101];
bool f1 = true, f2 = true;
int main() {
  int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++) {
    s1[i] = -1;
    s2[i] = -1;
    for (j = 0; j < n; j++) {
      if (a[i][j] == '.') s1[i] = j;
      if (a[j][i] == '.') s2[i] = j;
    }
    if (s1[i] < 0) f1 = false;
    if (s2[i] < 0) f2 = false;
  }
  if (f1) {
    for (i = 0; i < n; i++) cout << i + 1 << " " << s1[i] + 1 << endl;
  } else if (f2) {
    for (i = 0; i < n; i++) cout << s2[i] + 1 << " " << i + 1 << endl;
  } else
    cout << -1;
  return 0;
}
