#include <bits/stdc++.h>
using namespace std;
char s[102][102];
struct node {
  int x, y;
};
node a[102], b[102];
int main() {
  int n;
  cin >> n;
  int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= n; j++) {
      if (s[i][j] == '.') {
        sum1++;
        a[i].x = i;
        a[i].y = j;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (s[j][i] == '.') {
        sum2++;
        b[i].x = j;
        b[i].y = i;
        break;
      }
    }
  }
  if (sum1 != n && sum2 != n) {
    cout << -1 << endl;
    return 0;
  }
  if (sum1 == n) {
    for (int i = 1; i <= n; i++) {
      cout << a[i].x << " " << a[i].y << endl;
    }
  } else {
    for (int i = 1; i <= n; i++) {
      cout << b[i].x << " " << b[i].y << endl;
    }
  }
}
