#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long INF = 1e9 + 5;
const long long mod = 1e9 + 7;
const double pi = 3.1415926536;
int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
bool visr[105], visc[105];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  int n;
  cin >> n;
  char arr[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  }
  vector<pair<int, int> > ans, ans2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == '.' && !visr[i]) {
        visr[i] = 1;
        ans.push_back({i + 1, j + 1});
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == '.' && !visc[j]) {
        visc[j] = 1;
        ans2.push_back({i + 1, j + 1});
      }
    }
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (visr[i]) cnt1++;
    if (visc[i]) cnt2++;
  }
  if (cnt1 != n && cnt2 != n)
    return cout << "-1\n", 0;
  else if (cnt1 == n)
    for (int i = 0; i < ans.size(); i++)
      cout << ans[i].first << " " << ans[i].second << endl;
  else if (cnt2 == n)
    for (int i = 0; i < ans2.size(); i++)
      cout << ans2[i].first << " " << ans2[i].second << endl;
  return 0;
}
