#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int dx[] = {1, 0, -1, 0, -1, -1, 1, 1};
const int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
const int OO = INT_MAX;
const int MAX = 101;
char grid[MAX][MAX];
int nCell;
vector<pair<int, int> > getRows() {
  vector<pair<int, int> > res;
  for (int i = 0; i < nCell; i++) {
    for (int j = 0; j < nCell; j++) {
      if (grid[i][j] == '.') {
        res.push_back({i, j});
        break;
      }
    }
  }
  return res;
}
vector<pair<int, int> > getColums() {
  vector<pair<int, int> > res;
  for (int i = 0; i < nCell; i++) {
    for (int j = 0; j < nCell; j++) {
      if (grid[j][i] == '.') {
        res.push_back({j, i});
        break;
      }
    }
  }
  return res;
}
void printValues(vector<pair<int, int> > res) {
  for (int i = 0; i < (int)res.size(); i++) {
    cout << res[i].first + 1 << ' ' << res[i].second + 1 << '\n';
  }
}
int main() {
  cin >> nCell;
  for (int i = 0; i < nCell; i++) {
    cin >> grid[i];
  }
  vector<pair<int, int> > rows = getRows();
  vector<pair<int, int> > cols = getColums();
  if ((int)rows.size() == nCell) {
    printValues(rows);
    return 0;
  }
  if ((int)cols.size() == nCell) {
    printValues(cols);
    return 0;
  }
  cout << "-1" << '\n';
  return 0;
}
