#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e2 + 5;
int n;
char store[MAX][MAX];
void build() { return; }
void Init() {
  scanf("%d", &n);
  for (int i = (1); i < (n + 1); ++i) scanf("%s", store[i] + 1);
  return;
}
vector<pair<int, int> > ans;
void sol() {
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (1); j < (n + 1); ++j)
      if (store[i][j] == '.') {
        ans.push_back(make_pair(i, j));
        break;
      }
  }
  if (ans.size() == n) {
    for (pair<int, int> x : ans) printf("%d %d\n", x.first, x.second);
    return;
  } else
    ans.clear();
  for (int j = (1); j < (n + 1); ++j) {
    for (int i = (1); i < (n + 1); ++i)
      if (store[i][j] == '.') {
        ans.push_back(make_pair(i, j));
        break;
      }
  }
  if (ans.size() == n) {
    for (pair<int, int> x : ans) printf("%d %d\n", x.first, x.second);
  } else
    puts("-1");
  return;
}
int main(void) {
  Init();
  build();
  sol();
  return 0;
}
