#include <bits/stdc++.h>
using namespace std;
int n;
char mat[200][200];
int hor[200], ver[200];
bool v = 1, h = 1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) hor[i] = ver[i] = n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> mat[i][j];
      if (mat[i][j] == 'E') {
        hor[i]--;
        ver[j]--;
        if (!hor[i]) h = false;
        if (!ver[j]) v = false;
      }
    }
  if (!h and !v) {
    puts("-1");
    return 0;
  }
  if (h) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (mat[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
  } else {
    for (int j = 1; j <= n; j++)
      for (int i = 1; i <= n; i++)
        if (mat[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
  }
}
