#include <bits/stdc++.h>
using namespace std;
int n, row[111], col[111], r, c;
char s[111][111];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= n; j++) {
      if (s[i][j] == '.') {
        if (row[j] == 0) row[j] = i, r++;
        if (col[i] == 0) col[i] = j, c++;
      }
    }
  }
  if (r == n) {
    for (int i = 1; i <= n; i++) cout << row[i] << " " << i << endl;
  } else if (c == n) {
    for (int i = 1; i <= n; i++) cout << i << " " << col[i] << endl;
  } else
    cout << -1;
}
