#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
int n;
char a[101][101];
int main() {
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int b1 = 0;
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == '.') b1 = 1;
    }
    cnt += b1;
  }
  if (cnt == n) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (a[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
    return 0;
  }
  cnt = 0;
  for (int i = 1; i <= n; i++) {
    int b1 = 0;
    for (int j = 1; j <= n; j++)
      if (a[j][i] == '.') b1 = 1;
    cnt += b1;
  }
  if (cnt == n) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (a[j][i] == '.') {
          cout << j << " " << i << endl;
          break;
        }
    return 0;
  }
  cout << -1;
  return 0;
}
