#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
char a[100][100];
void solution() {
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for (int i = 0; i < int(n); i++)
    for (int j = 0; j < int(n); j++) {
      cin >> a[i][j];
      x[i] += a[i][j] == 'E';
      y[j] += a[i][j] == 'E';
    }
  sort((x).begin(), (x).end());
  sort((y).begin(), (y).end());
  if (x[n - 1] == n && y[n - 1] == n) {
    cout << -1;
    return;
  }
  if (x[n - 1] == n) {
    for (int j = 0; j < int(n); j++)
      for (int i = 0; i < int(n); i++) {
        if (a[i][j] != 'E') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
  } else {
    for (int i = 0; i < int(n); i++)
      for (int j = 0; j < int(n); j++) {
        if (a[i][j] != 'E') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
  }
}
int main() {
  double beg = clock();
  ios::sync_with_stdio(false);
  solution();
  return 0;
}
