#include <bits/stdc++.h>
struct node {
  int x, y;
};
char mp[105][105];
using namespace std;
int n;
int main() {
  while (cin >> n) {
    for (int i = 1; i <= n; i++) scanf("%s", &mp[i][1]);
    queue<node> que1;
    for (int i = 1; i <= n; i++) {
      int flag = 0;
      for (int j = 1; j <= n; j++) {
        if (mp[i][j] == '.') {
          flag = 1;
          node z;
          z.x = i;
          z.y = j;
          que1.push(z);
          break;
        }
      }
      if (flag == 0) break;
    }
    if (que1.size() == n) {
      node z;
      while (!que1.empty()) {
        z = que1.front();
        que1.pop();
        cout << z.x << " " << z.y << endl;
      }
      continue;
    }
    queue<node> que2;
    for (int i = 1; i <= n; i++) {
      int flag = 0;
      for (int j = 1; j <= n; j++) {
        if (mp[j][i] == '.') {
          flag = 1;
          node z;
          z.x = j;
          z.y = i;
          que2.push(z);
          break;
        }
      }
      if (flag == 0) break;
    }
    if (que2.size() == n) {
      node z;
      while (!que2.empty()) {
        z = que2.front();
        que2.pop();
        cout << z.x << " " << z.y << endl;
      }
      continue;
    }
    cout << -1 << endl;
  }
  return 0;
}
