#include <bits/stdc++.h>
using namespace std;
int n, a[110] = {0}, d[110] = {0};
bool b[110][110] = {0};
int main() {
  int i, j;
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      char c;
      cin >> c;
      if (c == '.')
        b[i][j] = 1, a[i] = j, d[j] = i;
      else
        b[i][j] = 0;
    }
  bool bo = 0;
  for (i = 1; i <= n; i++)
    if (!a[i]) bo = 1;
  if (!bo) {
    for (i = 1; i <= n; i++) cout << i << ' ' << a[i] << endl;
    return 0;
  }
  bo = 0;
  for (i = 1; i <= n; i++)
    if (!d[i]) bo = 1;
  if (!bo) {
    for (i = 1; i <= n; i++) cout << d[i] << ' ' << i << endl;
    return 0;
  }
  puts("-1");
  return 0;
}
