#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
struct node {
  int x, y;
  node(int x = 0, int y = 0) : x(x), y(y) {}
};
const int N = 233;
bool vis[N];
node ans[N];
char s[N][N];
int n;
bool ok;
int main() {
  ok = true;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    bool flag = false;
    scanf("%s", s[i]);
    for (int j = 0; j < n; ++j)
      if (s[i][j] == '.') {
        ans[i] = node(i, j);
        flag = true;
        break;
      }
    if (!flag) ok = false;
  }
  if (ok) {
    for (int i = 0; i < n; ++i) printf("%d %d\n", ans[i].x + 1, ans[i].y + 1);
    return 0;
  }
  if (!ok) {
    memset(ans, 0, sizeof(ans));
    ok = true;
    for (int i = 0; i < n; ++i) {
      bool flag = false;
      for (int j = 0; j < n; ++j)
        if (s[j][i] == '.') {
          ans[i] = node(j, i);
          flag = true;
        }
      if (!flag) ok = false;
    }
  }
  if (!ok) {
    printf("-1\n");
    exit(0);
  }
  for (int i = 0; i < n; ++i) printf("%d %d\n", ans[i].x + 1, ans[i].y + 1);
  return 0;
}
