#include <bits/stdc++.h>
using namespace std;
long long POS(long long x) {
  if (x > 0)
    return x;
  else
    return 0;
}
struct ele {
  long double z, y, x;
  ele() {}
  ele(long double z, long double y, long double x) : z(z), y(y), x(x) {}
  ele operator+(const ele &p) const { return ele(z + p.z, y + p.y, x + p.x); }
  ele operator-(const ele &p) const { return ele(z - p.z, y - p.y, x - p.x); }
  ele operator*(long double con) const {
    return ele(z * con, y * con, x * con);
  }
  ele operator/(long double con) const {
    return ele(z / con, y / con, x / con);
  }
  bool operator<(const ele &rhs) const {
    return make_pair(z, make_pair(y, x)) <
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
  bool operator==(const ele &rhs) const {
    return make_pair(z, make_pair(y, x)) ==
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
};
const bool testing = 0;
void program() {
  int n;
  cin >> n;
  vector<string> v(n);
  vector<int> rowfilld(n), colfilld(n);
  for (int i = (0); i < (n); ++i) {
    cin >> v[i];
  }
  for (int i = (0); i < (n); ++i) {
    int flag = 0;
    for (int j = (0); j < (n); ++j) {
      if (v[i][j] != 'E') flag = 1;
    }
    if (flag == 0) rowfilld[i] = 1;
  }
  for (int i = (0); i < (n); ++i) {
    int flag = 0;
    for (int j = (0); j < (n); ++j) {
      if (v[j][i] != 'E') flag = 1;
    }
    if (flag == 0) colfilld[i] = 1;
  }
  if (*max_element(rowfilld.begin(), rowfilld.end()) > 0 &&
      *max_element(colfilld.begin(), colfilld.end()) > 0) {
    cout << -1 << endl;
    return;
  }
  if (*max_element(rowfilld.begin(), rowfilld.end()) == 0) {
    for (int i = (0); i < (n); ++i) {
      for (int j = (0); j < (n); ++j) {
        if (v[i][j] != 'E') {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  } else {
    for (int i = (0); i < (n); ++i) {
      for (int j = (0); j < (n); ++j) {
        if (v[j][i] != 'E') {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  }
}
int main() {
  if (!testing) {
    program();
    return 0;
  }
  FILE *fin = NULL;
  fin = fopen("in.txt", "w+");
  fprintf(fin, "3\n.E.\nE.E\n.E.\n");
  fclose(fin);
  freopen("in.txt", "r", stdin);
  printf("test case(1) => expected : \n");
  printf("1 1\n2 2\n3 3\n");
  printf("test case(1) => founded  : \n");
  program();
  fin = fopen("in.txt", "w+");
  fprintf(fin, "3\nEEE\nE..\nE.E\n");
  fclose(fin);
  freopen("in.txt", "r", stdin);
  printf("test case(2) => expected : \n");
  printf("-1\n");
  printf("test case(2) => founded  : \n");
  program();
  fin = fopen("in.txt", "w+");
  fprintf(fin, "5\nEE.EE\nE.EE.\nE...E\n.EE.E\nEE.EE\n");
  fclose(fin);
  freopen("in.txt", "r", stdin);
  printf("test case(3) => expected : \n");
  printf("3 3\n1 3\n2 2\n4 4\n5 3");
  printf("test case(3) => founded  : \n");
  program();
  return 0;
}
