#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  char arr[n + 1][n + 1];
  bool f = 1;
  int a[n + 1];
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= n; ++i) {
    int x = 0;
    for (int j = 1; j <= n; ++j) {
      cin >> arr[i][j];
      x += (arr[i][j] == 'E');
      a[j] += (arr[i][j] == 'E');
    }
    if (x == n) {
      f = 0;
    }
  }
  if (!f) {
    for (int i = 1; i <= n; ++i) {
      if (a[i] == n) {
        cout << -1;
        return 0;
      }
    }
  }
  if (f) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (arr[i][j] == '.') {
          cout << i << " " << j << "\n";
          break;
        }
      }
    }
  } else {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (arr[j][i] == '.') {
          cout << j << " " << i << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
