#include <bits/stdc++.h>
using namespace std;
int n, a[10000][1000], res, flag, x[1000], y[1000], cnt;
char q;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> q;
      if (q == '.')
        a[i][j] = 1;
      else
        a[i][j] = 2;
    }
    scanf("\n");
  }
  res = n;
  cnt = 1;
  for (int i = 1; i <= n; i++) {
    flag = 0;
    for (int j = 1; j <= n; j++)
      if (a[j][i] == 1) {
        flag = 1;
        x[cnt] = j;
        y[cnt] = i;
        cnt++;
        break;
      }
    if (flag == 0) {
      res = -1;
      break;
    }
  }
  if (res == n) {
    for (int i = 1; i <= n; i++) cout << x[i] << " " << y[i] << "\n";
    return 0;
  }
  res = n;
  cnt = 1;
  for (int i = 1; i <= n; i++) {
    flag = 0;
    for (int j = 1; j <= n; j++)
      if (a[i][j] == 1) {
        flag = 1;
        x[cnt] = i;
        y[cnt] = j;
        cnt++;
        break;
      }
    if (flag == 0) {
      res = -1;
      break;
    }
  }
  if (res == n) {
    for (int i = 1; i <= n; i++) cout << x[i] << " " << y[i] << "\n";
    return 0;
  }
  cout << res;
  return 0;
}
