#include <bits/stdc++.h>
using namespace std;
char b[105][105];
int a[105];
int c[105];
int n;
int main() {
  cin >> n;
  int flag = 0;
  memset(a, -1, sizeof(a));
  memset(c, -1, sizeof(c));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) b[i][j] = '0';
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      cin >> b[i][j];
      if (b[i][j] != 'E')
        if (a[i] == -1) a[i] = j + 1;
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (b[j][i] != 'E')
        if (c[i] == -1) c[i] = j + 1;
    }
  for (int i = 0; i < n; i++) {
    if (a[i] == -1) {
      flag = 1;
      for (int j = 0; j < n; j++)
        if (c[j] == -1) {
          cout << -1 << endl;
          return 0;
        }
    }
  }
  if (!flag)
    for (int i = 0; i < n; i++) printf("%d %d\n", i + 1, a[i]);
  else
    for (int i = 0; i < n; i++) printf("%d %d\n", c[i], i + 1);
  return 0;
}
