#include <bits/stdc++.h>
using namespace std;
char Mat[100][100];
bool col[100], row[100];
vector<pair<int, int> > ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) scanf(" %c", &Mat[i][j]);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (Mat[i][j] == '.') {
        col[j] = 1;
        row[i] = 1;
        ans.push_back(make_pair(i + 1, j + 1));
        break;
      }
    }
  }
  if (ans.size() == n) {
    for (int i = 0; i < n; ++i)
      cout << ans[i].first << " " << ans[i].second << endl;
    return 0;
  }
  ans.clear();
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < n; ++i) {
      if (Mat[i][j] == '.') {
        col[j] = 1;
        row[i] = 1;
        ans.push_back(make_pair(i + 1, j + 1));
        break;
      }
    }
  }
  if (ans.size() == n)
    for (int i = 0; i < n; ++i)
      cout << ans[i].first << " " << ans[i].second << endl;
  else
    cout << "-1" << endl;
  return 0;
}
