#include <bits/stdc++.h>
using namespace std;
void FAST() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
string arr[107];
int n;
int main() {
  FAST();
  cin >> n;
  for (int first = 0; first < n; ++first) cin >> arr[first];
  int flagR = 1, flagC = 1;
  for (int first = 0; first < n; ++first) {
    flagR = 1;
    for (int second = 0; second < n; ++second) {
      if (arr[first][second] == '.') flagR = 0;
    }
    if (flagR) break;
  }
  for (int second = 0; second < n; ++second) {
    flagC = 1;
    for (int first = 0; first < n; ++first) {
      if (arr[first][second] == '.') flagC = 0;
    }
    if (flagC) break;
  }
  if (flagR && flagC) {
    cout << -1;
    return 0;
  }
  if (flagR) {
    for (int second = 0; second < n; ++second) {
      for (int first = 0; first < n; ++first) {
        if (arr[first][second] == '.') {
          cout << first + 1 << " " << second + 1 << "\n";
          break;
        }
      }
    }
  } else {
    for (int first = 0; first < n; ++first) {
      for (int second = 0; second < n; ++second) {
        if (arr[first][second] == '.') {
          cout << first + 1 << " " << second + 1 << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
