#include <bits/stdc++.h>
using namespace std;
char c[111][111];
int D[111], N[111];
vector<pair<int, int> > ans;
int NN[111], DD[111];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", c[i]);
    N[i] = n;
    D[i] = n;
    for (int j = 0; j < n; j++) {
      NN[i] += (c[i][j] == '.');
      DD[j] += (c[i][j] == '.');
    }
  }
  int cnt = 0;
  bool done = false;
  for (int i = 0; i < n; i++) {
    if (!NN[i]) done = true;
  }
  if (!done) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (c[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
      }
    }
    return 0;
  }
  done = false;
  for (int i = 0; i < n; i++) {
    if (!DD[i]) done = true;
  }
  if (!done) {
    for (int j = 0; j < n; j++)
      for (int i = 0; i < n; i++)
        if (c[i][j] == '.') {
          printf("%d %d\n", i + 1, j + 1);
          break;
        }
    return 0;
  }
  if (done) {
    printf("-1");
    return 0;
  }
}
