#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool grid[n][n];
  for (int i = 0; i < n; ++i) {
    string input;
    cin >> input;
    for (int j = 0; j < n; ++j) {
      if (input[j] == '.') {
        grid[i][j] = true;
      } else {
        grid[i][j] = false;
      }
    }
  }
  int sol[n];
  int solved = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (grid[i][j]) {
        ++solved;
        sol[i] = j;
        break;
      }
    }
  }
  if (solved == n) {
    for (int i = 0; i < n; ++i) {
      cout << i + 1 << " " << sol[i] + 1 << endl;
    }
    return 0;
  }
  solved = 0;
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < n; ++i) {
      if (grid[i][j]) {
        ++solved;
        sol[j] = i;
        break;
      }
    }
  }
  if (solved == n) {
    for (int i = 0; i < n; ++i) {
      cout << sol[i] + 1 << " " << i + 1 << endl;
    }
    return 0;
  }
  cout << "-1";
  return 0;
}
