#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> v(n);
  vector<vector<bool> > vis(n, vector<bool>(n, 0));
  for (int i = (0); i < (n); i++) cin >> v[i];
  int c1 = 0, c2 = 0;
  for (int i = (0); i < (n); i++) {
    bool gd1 = false, gd2 = false;
    for (int j = (0); j < (n); j++) {
      gd1 |= (v[i][j] == '.');
      gd2 |= (v[j][i] == '.');
    }
    c1 += gd1, c2 += gd2;
  }
  if (c1 != n && c2 != n) {
    cout << -1 << endl;
    return 0;
  }
  vector<pair<int, int> > res;
  if (c1 == n)
    for (int i = (0); i < (n); i++)
      for (int j = (0); j < (n); j++) {
        if (v[i][j] == '.') {
          res.push_back(make_pair(i + 1, j + 1));
          for (int k = (0); k < (n); k++) vis[i][k] = 1, vis[k][j] = 1;
          break;
        }
      }
  else
    for (int i = (0); i < (n); i++)
      for (int j = (0); j < (n); j++) {
        if (v[j][i] == '.') {
          res.push_back(make_pair(j + 1, i + 1));
          for (int k = (0); k < (n); k++) vis[j][k] = 1, vis[k][i] = 1;
          break;
        }
      }
  for (int i = (0); i < ((int)res.size()); i++)
    cout << res[i].first << " " << res[i].second << endl;
  return 0;
}
