#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char map[102][102];
  bool rcbd = true, ccbd = true;
  cin >> n;
  for (int i = 1; i <= n; i++) map[i][0] = map[0][i] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> map[i][j];
      if (map[i][j] == 'E') {
        map[i][0]++;
        map[0][j]++;
      }
    }
  for (int i = 1; i <= n; i++)
    if (map[i][0] == n) {
      rcbd = false;
      for (int j = 1; j <= n; j++)
        if (map[0][j] == n) {
          ccbd = false;
          break;
        }
      if (!ccbd) break;
    }
  if (!rcbd && !ccbd)
    cout << "-1";
  else {
    if (!rcbd)
      for (int i = 1; i <= n; i++)
        for (int j = i + 1; j <= n; j++) swap(map[i][j], map[j][i]);
    for (int i = 1; i <= n; i++) map[i][0] = map[0][i] = 'U';
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (map[i][j] == '.') {
          if (map[0][j] == 'U') {
            if (rcbd)
              cout << i << " " << j << endl;
            else
              cout << j << " " << i << endl;
            map[i][0] = map[0][j] = 'D';
            break;
          }
          bool flag = true;
          for (int k = j + 1; k <= n; k++)
            if (map[i][k] == '.' && map[0][k] == 'U') {
              flag = false;
              break;
            }
          if (flag) {
            if (rcbd)
              cout << i << " " << j << endl;
            else
              cout << j << " " << i << endl;
            map[i][0] = 'D';
            break;
          }
        }
  }
}
