#include <bits/stdc++.h>
using namespace std;
bool a[110][110];
int mp[110];
bool path[110], path1[110];
int n;
bool g = false;
bool kuhn(int x) {
  path[x] = true;
  for (int i = 0; i < n; i++)
    if (a[x][i] && (mp[i] == -1 || (!path[mp[i]] && kuhn(mp[i])))) {
      mp[i] = x;
      path[x] = false;
      return true;
    }
  path[x] = false;
  return false;
}
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    for (int h = 0; h < n; h++) {
      char c;
      scanf("%c", &c);
      if (c == 'E')
        a[i][h] = false;
      else
        a[i][h] = true;
    }
    scanf("\n");
  }
  fill(mp, mp + n, -1);
  for (int i = 0; i < n; i++) {
    if (i == n - 1) g = true;
    path1[i] = kuhn(i);
  }
  stack<pair<int, int> > s1;
  stack<pair<int, int> > s2;
  stack<pair<int, int> > st;
  for (int i = 0; i < n; i++) {
    if (!path1[i])
      for (int h = 0; h < n; h++)
        if (a[i][h]) {
          s1.push(make_pair(i, h));
          break;
        }
    if (mp[i] == -1) {
      for (int h = 0; h < n; h++)
        if (a[h][i]) {
          s2.push(make_pair(h, i));
          break;
        }
    } else
      st.push(make_pair(mp[i], i));
  }
  if (s1.size() + st.size() == n)
    while (s1.size()) {
      printf("%d %d\n", s1.top().first + 1, s1.top().second + 1);
      s1.pop();
    }
  else if (s2.size() + st.size() == n)
    while (s2.size()) {
      printf("%d %d\n", s2.top().first + 1, s2.top().second + 1);
      s2.pop();
    }
  else {
    printf("-1");
    return 0;
  }
  while (st.size()) {
    printf("%d %d\n", st.top().first + 1, st.top().second + 1);
    st.pop();
  }
  return 0;
}
