#include <bits/stdc++.h>
using namespace std;
int n, sr, sb;
bool str[10000], stb[10000];
char a[1000][1000];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == '.') {
        if (!str[i]) {
          str[i] = true;
          sr++;
        }
        if (!stb[j]) {
          stb[j] = true;
          sb++;
        }
      }
    }
  if (sr == 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;
  }
  if (sb == 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;
}
