#include <bits/stdc++.h>
using namespace std;
int ans[128];
char maze[128][128];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", maze[i]);
  bool isok = true;
  for (int i = 0; i < n && isok; i++) {
    bool ok = false;
    for (int j = 0; j < n && !ok; j++)
      if (maze[i][j] == '.') {
        ans[i] = j;
        ok = true;
      }
    if (!ok) isok = false;
  }
  if (isok)
    for (int i = 0; i < n; i++) printf("%d %d\n", i + 1, ans[i] + 1);
  if (isok) return 0;
  isok = true;
  for (int i = 0; i < n && isok; i++) {
    bool ok = false;
    for (int j = 0; j < n && !ok; j++)
      if (maze[j][i] == '.') {
        ans[i] = j;
        ok = true;
      }
    if (!ok) isok = false;
  }
  if (isok)
    for (int i = 0; i < n; i++) printf("%d %d\n", ans[i] + 1, i + 1);
  if (isok) return 0;
  printf("-1\n");
  return 0;
}
