#include <bits/stdc++.h>
using namespace std;
int main() {
  short int q, w, e, r, t;
  bool a[100][100], a1[100], a2[100];
  char s[101];
  cin >> q;
  for (w = 0; w < q; w++) a1[w] = a2[w] = 0;
  for (w = 0; w < q; w++) {
    cin >> s;
    for (e = 0; e < q; e++)
      if (s[e] == '.') {
        a[w][e] = 1;
        a1[w] = 1;
        a2[e] = 1;
      } else
        a[w][e] = 0;
  }
  e = 0;
  for (w = 0; w < q; w++)
    if (a1[w]) e++;
  if (e == q) {
    for (w = 0; w < q; w++)
      for (e = 0; e < q; e++)
        if (a[w][e]) {
          cout << w + 1 << ' ' << e + 1 << "\n";
          break;
        }
  } else {
    e = 0;
    for (w = 0; w < q; w++)
      if (a2[w]) e++;
    if (e == q) {
      for (e = 0; e < q; e++)
        for (w = 0; w < q; w++)
          if (a[w][e]) {
            cout << w + 1 << ' ' << e + 1 << "\n";
            break;
          }
    } else
      cout << -1;
  }
  return 0;
}
