#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n;
char a[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  bool row, col;
  for (int i = 1; i <= n; i++) {
    row = true;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == '.') {
        row = false;
      }
    }
    if (row) {
      break;
    }
  }
  for (int j = 1; j <= n; j++) {
    col = true;
    for (int i = 1; i <= n; i++) {
      if (a[i][j] == '.') {
        col = false;
      }
    }
    if (col) {
      break;
    }
  }
  if (col && row) {
    return cout << "-1", 0;
  }
  if (!row) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (a[i][j] == '.') {
          cout << i << " " << j << '\n';
          break;
        }
      }
    }
  } else {
    for (int j = 1; j <= n; j++) {
      for (int i = 1; i <= n; i++) {
        if (a[i][j] == '.') {
          cout << i << " " << j << '\n';
          break;
        }
      }
    }
  }
}
