#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n;
vector<int> x[100], y[100];
bool f(vector<int> p[100], int r) {
  for (int i = 0; i < n; i++)
    if (p[i].size() == 0) return false;
  for (int i = 0; i < n; i++)
    if (r)
      cout << i + 1 << " " << p[i][0] + 1 << endl;
    else
      cout << p[i][0] + 1 << " " << i + 1 << endl;
  return true;
}
int main() {
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < n; j++)
      if (s[j] == '.') x[i].push_back(j), y[j].push_back(i);
  }
  if (f(x, 1) || f(y, 0)) return 0;
  cout << -1 << endl;
  return 0;
}
