#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T x, T y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
const double INF = 1e+9;
const double INFLL = 1e+18;
const double EPS = 1e-9;
const double PI = acos(-1);
const int knightDir[8][2] = {{-2, -1}, {-2, 1}, {-1, 2},  {1, 2},
                             {2, -1},  {2, 1},  {-1, -2}, {1, -2}};
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
int main() {
  int l[110], r[110];
  for (int i = 0; i < 110; i++) l[i] = -1, r[i] = -1;
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      char ch;
      cin >> ch;
      if (ch == '.') {
        r[i] = j;
        l[j] = i;
      }
    }
  }
  bool lg = true, rg = true;
  for (int i = 1; i <= n; i++) {
    if (r[i] == -1) rg = false;
    if (l[i] == -1) lg = false;
  }
  if (lg || rg) {
    if (rg) {
      for (int i = 1; i <= n; i++) {
        printf("%d %d\n", i, r[i]);
      }
    } else {
      for (int i = 1; i <= n; i++) {
        printf("%d %d\n", l[i], i);
      }
    }
  } else {
    printf("-1\n");
  }
}
