#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n;
char s[N][N];
map<int, pair<int, int> > row, col;
int r, c, visr[N], visc[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i] + 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (s[i][j] == 'E') continue;
      if (!row.count(i)) row[i] = {i, j}, r++;
      if (!col.count(j)) col[j] = {i, j}, c++;
    }
  }
  if (r == n) {
    for (int i = 1; i <= n; i++)
      cout << row[i].first << ' ' << row[i].second << endl;
  } else if (c == n) {
    for (int i = 1; i <= n; i++)
      cout << col[i].first << ' ' << col[i].second << endl;
  } else
    puts("-1");
  return 0;
}
