#include <bits/stdc++.h>
using namespace std;
bool vis[150][150];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n;
  cin >> n;
  vector<pair<int64_t, int64_t>> cord;
  char a[n][n];
  for (auto& x : a)
    for (auto& y : x) cin >> y;
  int64_t evil = n * n;
  while (evil) {
    pair<int64_t, int64_t> cor = {-1, -1};
    int64_t best = 0;
    for (int64_t i = 0; i < n; ++i)
      for (int64_t j = 0; j < n; ++j) {
        if (a[i][j] == '.') {
          int64_t sum = 0;
          for (int64_t k = 0; k < n; ++k) sum += !vis[i][k] + !vis[k][j];
          if (!vis[i][j]) sum--;
          if (sum >= best and sum) {
            best = sum;
            cor = {i, j};
          }
        }
      }
    if (cor.first == -1 and cor.second == -1)
      break;
    else {
      evil -= best;
      cord.push_back({cor.first + 1, cor.second + 1});
      for (int64_t i = 0; i < n; ++i)
        vis[cor.first][i] = vis[i][cor.second] = 1;
    }
  }
  if (evil) return puts("-1") * 0;
  for (auto& x : cord) cout << x.first << ' ' << x.second << '\n';
}
