#include <bits/stdc++.h>
using namespace std;
bool maze[120][120];
bool row[120], col[120];
int main() {
  memset(maze, 0, sizeof(maze));
  memset(row, 0, sizeof(row));
  memset(col, 0, sizeof(col));
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      char c;
      cin >> c;
      if (c == '.') {
        maze[i][j] = true;
        row[i] = col[j] = true;
      }
    }
  }
  int rows = 0;
  int cols = 0;
  for (int i = 1; i <= n; i++) {
    if (row[i]) rows++;
    if (col[i]) cols++;
  }
  if (rows != n && cols != n) {
    cout << "-1" << endl;
  } else {
    if (rows == n) {
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
          if (maze[i][j]) {
            cout << i << ' ' << j << endl;
            break;
          }
        }
      }
    } else {
      for (int j = 1; j <= n; j++) {
        for (int i = 1; i <= n; i++) {
          if (maze[i][j]) {
            cout << i << ' ' << j << endl;
            break;
          }
        }
      }
    }
  }
  return 0;
}
