#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, k;
  int n;
  cin >> n;
  vector<vector<int>> grid(n, vector<int>(n, 0));
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (j = 0; j < n; j++) {
      if (s[j] == 'E') grid[i][j] = 1;
    }
  }
  vector<int> row(n, 0);
  int r = 0;
  vector<int> col(n, 0);
  int c = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (grid[i][j] == 0) {
        col[j] = 1;
        row[i] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    r += row[i];
    c += col[i];
  }
  if (r < n and c < n) {
    cout << -1 << endl;
    return 0;
  }
  vector<pair<int, int>> ans;
  if (r == n) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (grid[i][j] == 0) {
          ans.push_back(make_pair(i, j));
          break;
        }
      }
    }
  } else {
    for (j = 0; j < n; j++) {
      for (i = 0; i < n; i++) {
        if (grid[i][j] == 0) {
          ans.push_back(make_pair(i, j));
          break;
        }
      }
    }
  }
  for (auto it : ans) {
    cout << it.first + 1 << " " << it.second + 1 << endl;
  }
  return 0;
}
