#include <bits/stdc++.h>
using namespace std;
template <typename Iter>
ostream& _out(ostream& s, Iter a, Iter b) {
  for (auto it = a; it != b; it++) s << (it == a ? "" : " ") << *it;
  return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, pair<A, B>& p) {
  return s << "(" << p.first << " , " << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T>& v) {
  return _out(s, v.begin(), v.end());
}
inline long long rit() {
  int key = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') key = -1;
    c = getchar();
  }
  long long x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * key;
}
int __ = 1;
void init() {}
void read() {}
void solve() {}
char a[110][110];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%s", a[i] + 1);
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    int ok = 0;
    for (int j = 1; j <= n; j++)
      if (a[i][j] == '.') {
        ans.push_back(j);
        ok = 1;
        break;
      }
    if (ok == 0) break;
  }
  if (ans.size() == n) {
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", i + 1, ans[i]);
    }
    return 0;
  }
  ans.clear();
  for (int i = 1; i <= n; i++) {
    int ok = 0;
    for (int j = 1; j <= n; j++)
      if (a[j][i] == '.') {
        ans.push_back(j);
        ok = 1;
        break;
      }
    if (ok == 0) break;
  }
  if (ans.size() == n) {
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", ans[i], i + 1);
    }
    return 0;
  } else {
    puts("-1");
  }
  return 0;
}
