#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char cell[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> cell[i][j];
  vector<pair<int, int> > row_points;
  vector<pair<int, int> > column_points;
  int row_count = 0, column_count = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (cell[i][j] == 'E')
        continue;
      else {
        row_points.push_back(make_pair(i + 1, j + 1));
        row_count++;
        break;
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (cell[j][i] == 'E')
        continue;
      else {
        column_points.push_back(make_pair(j + 1, i + 1));
        column_count++;
        break;
      }
    }
  if (row_count < n && column_count < n)
    cout << -1 << endl;
  else if (row_count == n) {
    for (int i = 0; i < n; i++)
      cout << row_points[i].first << " " << row_points[i].second << endl;
  } else if (column_count == n) {
    for (int i = 0; i < n; i++)
      cout << column_points[i].first << " " << column_points[i].second << endl;
  }
}
