#include <bits/stdc++.h>
using namespace std;
int n;
char a[111][111];
vector<pair<int, int> > v, vv;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (a[i][j] == '.') {
        v.push_back(make_pair(i, j));
        break;
      }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (a[j][i] == '.') {
        vv.push_back(make_pair(j, i));
        break;
      }
  if (v.size() == n)
    for (int i = 0; i < n; i++)
      cout << v[i].first << " " << v[i].second << endl;
  else if (vv.size() == n)
    for (int i = 0; i < n; i++)
      cout << vv[i].first << " " << vv[i].second << endl;
  else
    cout << -1;
  return 0;
}
