#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  char arr[n][n];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) cin >> arr[i][j];
  }
  int m = 0, c = 0;
  set<int> row;
  set<int> col;
  for (int i = 0; i < n; ++i) {
    c = 0;
    for (int j = 0; j < n; ++j) {
      if (arr[i][j] == 'E') c++;
    }
    cout << "\n";
    if (c == n) {
      row.insert(i);
    }
  }
  for (int i = 0; i < n; ++i) {
    c = 0;
    for (int j = 0; j < n; ++j) {
      if (arr[j][i] == 'E') c++;
    }
    if (c == n) {
      col.insert(i);
    }
  }
  for (set<int>::iterator it = row.begin(); it != row.end(); ++it) {
    for (set<int>::iterator i = col.begin(); i != col.end(); ++i) {
      if (arr[*it][*i] == 'E') cout << -1 << "\n";
      return 0;
    }
  }
  if (row.empty()) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (arr[i][j] != 'E') {
          cout << i + 1 << " " << j + 1 << "\n";
          break;
        }
      }
    }
  } else {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (arr[j][i] != 'E') {
          cout << j + 1 << " " << i + 1 << "\n";
          break;
        }
      }
    }
  }
}
