#include <bits/stdc++.h>
using namespace std;
int n, m;
char g[105][105];
vector<pair<int, int> > ans, ans2;
bool f[105][105];
void work() {
  int i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%s", g[i] + 1);
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j)
      if (g[i][j] == '.') {
        ans.push_back(make_pair(i, j));
        break;
      }
    if (j > n) {
      m = 1;
      break;
    }
  }
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j)
      if (g[j][i] == '.') {
        ans2.push_back(make_pair(j, i));
        break;
      }
    if (j > n) {
      break;
    }
  }
  if (m == 1 && i <= n) {
    puts("-1");
  } else if (!m) {
    for (i = 0; i < n; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
  } else {
    for (i = 0; i < n; ++i) printf("%d %d\n", ans2[i].first, ans2[i].second);
  }
}
int main() {
  work();
  return 0;
}
