#include <bits/stdc++.h>
using namespace std;
char mp[105][105];
int main() {
  vector<pair<int, int>> ans;
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cin >> mp[i][j];
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (mp[i][j] == '.') {
        ans.push_back({i, j});
        break;
      }
    }
  }
  if (ans.size() == n) {
    for (auto elem : ans) cout << elem.first << " " << elem.second << "\n";
    return 0;
  }
  ans.clear();
  for (int j = 1; j <= n; ++j) {
    for (int i = 1; i <= n; ++i) {
      if (mp[i][j] == '.') {
        ans.push_back({i, j});
        break;
      }
    }
  }
  if (ans.size() == n) {
    for (auto elem : ans) cout << elem.first << " " << elem.second << "\n";
    return 0;
  }
  cout << "-1\n";
  return 0;
}
