#include <bits/stdc++.h>
using namespace std;
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
inline int gcd(int a, int b) {
  if (a % b)
    return gcd(b, a % b);
  else
    return b;
}
inline int lcm(int a, int b) { return (a * (b / gcd(a, b))); }
inline int And(int mask, int bit) { return mask & (1 << bit); }
inline int Or(int mask, int bit) { return mask | (1 << bit); }
inline int Xor(int mask, int bit) { return mask & (~(1 << bit)); }
int n, mark[111], one, two;
char s[111][111];
vector<pair<int, int> > road, ans;
bool isFail() {
  int cnt = 0;
  for (int i = 1; i <= n; i++) mark[i] = 0;
  for (int i = 0; i < (int)road.size(); i++) mark[road[i].first] = 1;
  for (int i = 1; i <= n; i++)
    if (mark[i]) cnt++;
  if (cnt == n) {
    one = 1;
    return false;
  }
  cnt = 0;
  for (int i = 1; i <= n; i++) mark[i] = 0;
  for (int i = 0; i < (int)road.size(); i++) mark[road[i].second] = 1;
  for (int i = 1; i <= n; i++)
    if (mark[i]) cnt++;
  if (cnt == n) {
    two = 1;
    return false;
  }
  return true;
}
bool cmp1(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first) return a.first < b.first;
  return a.second < b.second;
}
bool cmp2(pair<int, int> a, pair<int, int> b) {
  if (a.second != b.second) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  scanf(" %d ", &n);
  for (int i = 0; i < n; i++) gets(s[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (s[i][j] == '.') road.push_back(pair<int, int>(i + 1, j + 1));
  one = two = 0;
  if (isFail()) {
    puts("-1");
    return 0;
  }
  sort(road.begin(), road.end(), cmp1);
  if (one == 1) {
    ans.push_back(road[0]);
    for (int i = 1; i < (int)road.size(); i++)
      if (road[i].first != road[i - 1].first) ans.push_back(road[i]);
    for (int i = 0; i < (int)ans.size(); i++)
      printf("%d %d\n", ans[i].first, ans[i].second);
  } else {
    sort(road.begin(), road.end(), cmp2);
    ans.push_back(road[0]);
    for (int i = 1; i < (int)road.size(); i++)
      if (road[i].second != road[i - 1].second) ans.push_back(road[i]);
    for (int i = 0; i < (int)ans.size(); i++)
      printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
