#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mm;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  char grid[n + 1][n + 1];
  map<long long, long long> row, column;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cin >> grid[i][j];
      if (grid[i][j] == '.') {
        row[i] = j;
        column[j] = i;
      }
    }
  }
  if (row.size() == n) {
    for (auto it : row) {
      cout << it.first << " " << it.second << endl;
    }
    return 0;
  }
  if (column.size() == n) {
    for (auto it : column) {
      cout << it.second << " " << it.first << endl;
    }
    return 0;
  }
  cout << -1;
}
