#include <bits/stdc++.h>
using namespace std;
char a[110][110];
long long r[110], c[110];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, fr = 0, fc = 0;
  cin >> n;
  vector<pair<long long, long long>> col, row;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    long long k = 0;
    for (long long j = 0; j < n; j++) {
      if (a[i][j] == 'E') r[i]++;
      if (a[i][j] == '.' && k == 0) {
        row.push_back({i, j});
        k = 1;
      }
    }
    if (r[i] == n) fr = 1;
  }
  for (long long i = 0; i < n; i++) {
    long long k = 0;
    for (long long j = 0; j < n; j++) {
      if (a[j][i] == 'E') c[i]++;
      if (a[j][i] == '.' && k == 0) {
        col.push_back({j, i});
        k = 1;
      }
    }
    if (c[i] == n) fc = 1;
  }
  if (fr == 1 && fc == 1)
    cout << -1 << "\n";
  else if (fr == 1) {
    for (long long i = 0; i < n; i++)
      cout << col[i].first + 1 << " " << col[i].second + 1 << endl;
  } else {
    for (long long i = 0; i < n; i++)
      cout << row[i].first + 1 << " " << row[i].second + 1 << endl;
  }
  return 0;
}
