#include <bits/stdc++.h>
using namespace std;
int x[1001];
int main() {
  char s[101][101];
  int n;
  cin >> n;
  int arr[101];
  int brr[101];
  char c;
  int l = 0, p = 0, h = 0;
  for (int j = 1; j <= n; j++) {
    for (int k = 1; k <= n; k++) {
      cin >> c;
      s[j][k] = c;
    }
  }
  for (int j = 1; j <= n; j++) {
    for (int k = 1; k <= n; k++) {
      if (s[j][k] == '.') {
        arr[l++] = j;
        brr[p++] = k;
        break;
      }
    }
  }
  if (l == n) {
    for (int a = 0; a < l; a++) cout << arr[a] << " " << brr[a] << endl;
  } else {
    l = 0;
    p = 0;
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        if (s[k][j] == '.') {
          arr[l++] = k;
          brr[p++] = j;
          break;
        }
      }
    }
    if (l == n)
      for (int a = 0; a < l; a++) cout << arr[a] << " " << brr[a] << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
