#include <bits/stdc++.h>
using namespace std;
int n, h, v;
string s[110];
int wh[110], wv[110];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    s[i] = "#" + s[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (s[i][j] == '.') {
        if (wh[i] == 0) wh[i] = 1, h++;
        if (wv[j] == 0) wv[j] = 1, v++;
      }
    }
  }
  if (max(h, v) < n) {
    cout << -1 << endl;
    return 0;
  }
  if (h == n) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (s[i][j] == '.') {
          cout << i << " " << j << endl;
          break;
        }
  } else {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (s[j][i] == '.') {
          cout << j << " " << i << endl;
          break;
        }
  }
  return 0;
}
