#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 111;
bool ux[maxn], uy[maxn];
char c[maxn][maxn];
int n;
bool check() {
  for (int i = 1; i <= n; ++i) {
    bool u = false;
    for (int j = 1; j <= n; ++j) {
      if (c[i][j] != 'E') {
        u = true;
        break;
      }
    }
    if (!u) {
      return false;
    }
  }
  return true;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cin >> c[i][j];
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (c[i][j] == 'E') {
        bool u = false;
        for (int g = 1; g <= n; ++g) {
          if (c[i][g] != 'E') {
            u = true;
            break;
          }
        }
        if (u) {
          continue;
        }
        for (int g = 1; g <= n; ++g) {
          if (c[g][j] != 'E') {
            u = true;
            break;
          }
        }
        if (!u) {
          cout << -1;
          return 0;
        }
      }
    }
  }
  if (check()) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (c[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
      }
    }
  } else {
    for (int j = 1; j <= n; ++j) {
      for (int i = 1; i <= n; ++i) {
        if (c[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
      }
    }
  }
}
