#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 1e5 + 7;
char c[109][109];
bool l[109], r[109];
vector<pair<int, int> > vl[109], vr[109];
int main() {
  int i, j, k, n, m, x, y;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s", c[i] + 1);
    for (j = 1; j <= n; j++)
      if (c[i][j] == '.') {
        l[i] = r[j] = 1;
        vl[i].push_back(pair<int, int>(i, j));
        vr[j].push_back(pair<int, int>(i, j));
      }
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (!l[i] && !r[j]) {
        puts("-1");
        return 0;
      }
  for (i = 1; i <= n; i++)
    if (vl[i].size() == 0) break;
  if (i > n) {
    for (i = 1; i <= n; i++) printf("%d %d\n", vl[i][0].first, vl[i][0].second);
  } else {
    for (i = 1; i <= n; i++) printf("%d %d\n", vr[i][0].first, vr[i][0].second);
  }
  return 0;
}
