#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-8;
const int maxn = 300;
char maze[200][200];
struct Point {
  int x;
  int y;
};
vector<Point> p;
int main() {
  int n;
  while (cin >> n) {
    p.clear();
    int r = 0;
    int c = 0;
    for (int i = (0); i < (n); ++i) {
      scanf("%s", maze[i]);
      for (int j = (0); j < (n); ++j)
        if (maze[i][j] == '.') {
          r++;
          p.push_back((Point){i + 1, j + 1});
          break;
        }
    }
    if (r == n) {
      for (int i = (0); i < (n); ++i) cout << p[i].x << " " << p[i].y << endl;
      continue;
    }
    p.clear();
    for (int i = (0); i < (n); ++i)
      for (int j = (0); j < (n); ++j) {
        if (maze[j][i] == '.') {
          c++;
          p.push_back((Point){j + 1, i + 1});
          break;
        }
      }
    if (c == n) {
      for (int i = (0); i < (n); ++i) cout << p[i].x << " " << p[i].y << endl;
      continue;
    }
    cout << -1 << endl;
  }
  return 0;
}
