#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<bool> row(n + 1, true), col(n + 1, true);
  char** a = new char*[n + 1];
  for (int i = 1; i <= n; i++) a[i] = new char[n + 1];
  char c;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      row[i] = row[i] && (a[i][j] != '.');
      col[j] = col[j] && (a[i][j] != '.');
    }
    cin.get();
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (row[i] && col[j]) {
        cout << -1;
        return 0;
      }
  vector<int> ans;
  vector<bool> crow(n + 1, false), ccol(n + 1, false);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == '.' && (!ccol[j] || !crow[i]) && !ccol[j]) {
        crow[i] = true;
        ccol[j] = true;
        ans.push_back(i);
        ans.push_back(j);
      }
    }
  if (ans.size() == 2 * n) {
    for (int i = 0; i < n; i++) {
      cout << ans[2 * i] << " " << ans[2 * i + 1] << endl;
    }
    return 0;
  }
  ans.clear();
  vector<bool> crow1(n + 1, false), ccol1(n + 1, false);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == '.' && (!ccol1[j] || !crow1[i]) && !crow1[i]) {
        crow1[i] = true;
        ccol1[j] = true;
        ans.push_back(i);
        ans.push_back(j);
      }
    }
  for (int i = 0; i < n; i++) {
    cout << ans[2 * i] << " " << ans[2 * i + 1] << endl;
  }
  return 0;
}
