#include <bits/stdc++.h>
using namespace std;
string arr[200];
vector<pair<int, int> > V, res1, res2;
bool vis[200];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (arr[i][j] == '.') {
        V.push_back(make_pair(i + 1, j + 1));
      }
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < (int)V.size(); i++) {
    int v = V[i].first;
    if (!vis[v]) {
      res1.push_back(V[i]);
      vis[v] = 1;
    }
  }
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < (int)V.size(); i++) {
    int v = V[i].second;
    if (!vis[v]) {
      res2.push_back(V[i]);
      vis[v] = 1;
    }
  }
  if ((int)res1.size() == n)
    for (int i = 0; i < n; i++)
      cout << res1[i].first << " " << res1[i].second << endl;
  else if ((int)res2.size() == n)
    for (int i = 0; i < n; i++)
      cout << res2[i].first << " " << res2[i].second << endl;
  else
    puts("-1");
}
