#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y;
} ans[105];
char s[105][105];
vector<P> vec;
int main() {
  int i, j, n;
  while (scanf("%d", &n) != EOF) {
    vec.clear();
    for (i = 1; i <= n; i++) {
      scanf("%s", &s[i][1]);
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (s[i][j] == '.') {
          vec.push_back((P){i, j});
          break;
        }
      }
    }
    if (vec.size() == n) {
      for (i = 0; i < n; i++) {
        printf("%d %d\n", vec[i].x, vec[i].y);
      }
      continue;
    }
    vec.clear();
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (s[j][i] == '.') {
          vec.push_back((P){j, i});
          break;
        }
      }
    }
    if (vec.size() == n) {
      for (i = 0; i < n; i++) {
        printf("%d %d\n", vec[i].x, vec[i].y);
      }
      continue;
    } else
      puts("-1");
  }
}
