#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long double PI = 3.14159265;
long long int powerWithMod(long long int base, long long int exponent,
                           long long int modulus = LLONG_MAX) {
  long long int result = 1;
  base %= modulus;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent >>= 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long int gcdExtended(long long int a, long long int b, long long int *x,
                          long long int *y) {
  cout << a << " " << b << " " << *x << " " << *y << "\n";
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long int x1, y1;
  long long int gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  cout << "AFTER " << a << " " << b << " " << *x << " " << *y << "\n";
  return gcd;
}
long long int MODInverse(long long int a, long long int m) {
  long long int x, y;
  long long int g = gcdExtended(a, m, &x, &y);
  cout << g << " " << x << " " << y << "\n";
  long long int ans = (x % m + m) % m;
  return ans;
}
using namespace std;
map<int, pair<int, int>> row, column;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  char x;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> x;
      if (x == '.') {
        row[i] = make_pair(i, j);
        column[j] = make_pair(i, j);
      }
    }
  }
  if (row.size() == n) {
    for (auto x : row) cout << x.second.first << " " << x.second.second << "\n";
  } else if (column.size() == n) {
    for (auto x : column)
      cout << x.second.first << " " << x.second.second << "\n";
  } else
    cout << "-1\n";
  return 0;
}
