#include <bits/stdc++.h>
using namespace std;
const int num = 101;
string str[num];
int vis[101][101], mark[101], vis1[num][num];
vector<pair<int, int> > vect, vect1;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> str[i];
  int fl = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == '.') {
        vis[i][j] = 1;
        for (int k = 0; k < n; k++) vis[i][k] = 1;
        for (int k = 0; k < n; k++) vis[k][j] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (!vis[i][j]) {
        cout << "-1\n";
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) vis[i][j] = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == '.') {
        vect.push_back(make_pair(i, j));
        vis[i][j] = 1;
        for (int k = 0; k < n; k++) vis[i][k] = 1;
        for (int k = 0; k < n; k++) vis[k][j] = 1;
        break;
      }
    }
  }
  for (int j = 0; j < n; j++) {
    for (int i = 0; i < n; i++) {
      if (str[i][j] == 'E' && !vis[i][j]) {
        for (int k = 0; k < n; k++) {
          if (str[k][j] == '.') {
            vect.push_back(make_pair(k, j));
            break;
          }
        }
        break;
      }
    }
  }
  for (int j = 0; j < n; j++) {
    for (int i = 0; i < n; i++) {
      if (str[i][j] == '.') {
        vect1.push_back(make_pair(i, j));
        vis1[i][j] = 1;
        for (int k = 0; k < n; k++) vis1[i][k] = 1;
        for (int k = 0; k < n; k++) vis1[k][j] = 1;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == 'E' && !vis1[i][j]) {
        for (int k = 0; k < n; k++) {
          if (str[i][k] == '.') {
            vect1.push_back(make_pair(i, k));
            break;
          }
        }
        break;
      }
    }
  }
  if (vect1.size() < vect.size()) {
    for (int i = 0; i < vect1.size(); i++)
      cout << vect1[i].first + 1 << " " << vect1[i].second + 1 << "\n";
  } else {
    for (int i = 0; i < vect.size(); i++)
      cout << vect[i].first + 1 << " " << vect[i].second + 1 << "\n";
  }
  return 0;
}
