#include <bits/stdc++.h>
using namespace std;
string s[105];
bool r[105], c[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  memset(r, 0, sizeof r);
  memset(c, 0, sizeof c);
  for (int i = 0; i < n; i++) {
    r[i] = 1;
    for (int j = 0; j < n; j++)
      if (s[i][j] == '.') r[i] = 0;
  }
  for (int j = 0; j < n; j++) {
    c[j] = 1;
    for (int i = 0; i < n; i++)
      if (s[i][j] == '.') c[j] = 0;
  }
  bool R = 0, C = 0;
  for (int i = 0; i < n; i++)
    if (r[i]) R = 1;
  for (int i = 0; i < n; i++)
    if (c[i]) C = 1;
  if (R && C) {
    cout << "-1\n";
    return 0;
  }
  if (R) {
    for (int j = 0; j < n; j++)
      for (int i = 0; i < n; i++)
        if (s[i][j] == '.') {
          cout << i + 1 << ' ' << j + 1 << '\n';
          break;
        }
  } else {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        if (s[i][j] == '.') {
          cout << i + 1 << ' ' << j + 1 << '\n';
          break;
        }
  }
  return 0;
}
