#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> r[105], c[105];
char a[105][105];
int main() {
  cin >> n;
  getchar();
  for (int i = (1), _b = (n); i <= _b; i++) gets(a[i] + 1);
  bool noAns = false;
  for (int i = (1), _b = (n); i <= _b; i++) {
    for (int j = (1), _b = (n); j <= _b; j++)
      if (a[i][j] == '.') {
        r[i].push_back(j);
        c[j].push_back(i);
      }
  }
  int row = 0;
  int col = 0;
  for (int k = (1), _b = (n); k <= _b; k++) {
    if ((int)r[k].size()) row++;
    if ((int)c[k].size()) col++;
  }
  if (row == n) {
    for (int i = (1), _b = (n); i <= _b; i++) printf("%d %d\n", i, r[i][0]);
  } else if (col == n) {
    for (int j = (1), _b = (n); j <= _b; j++) printf("%d %d\n", c[j][0], j);
  } else
    puts("-1");
  return 0;
}
