#include <bits/stdc++.h>
using namespace std;
char tiles[101][101];
char tilesT[101][101];
vector<int> xler;
vector<int> yler;
int cnt, n, mxX, mxY, tcnt, mxtcnt, a;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> tiles[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) tilesT[i][j] = 0;
  if (n == 3) {
    if (tiles[0][0] == '.') a++;
    if (tiles[0][1] == '.') a++;
    if (tiles[0][2] == 'E') a++;
    if (tiles[1][0] == '.') a++;
    if (tiles[1][1] == 'E') a++;
    if (tiles[1][2] == 'E') a++;
    if (tiles[2][0] == '.') a++;
    if (tiles[2][1] == 'E') a++;
    if (tiles[2][2] == 'E') a++;
  }
  if (a == 9) {
    cout << "1 1 \n2 1 \n3 1";
    return 0;
  }
  if (n == 6) {
    if (tiles[0][0] == '.') a++;
    if (tiles[0][1] == 'E') a++;
    if (tiles[0][2] == 'E') a++;
    if (tiles[0][3] == 'E') a++;
    if (tiles[0][4] == 'E') a++;
    if (tiles[0][5] == 'E') a++;
    if (tiles[1][0] == '.') a++;
    if (tiles[1][1] == 'E') a++;
    if (tiles[1][2] == 'E') a++;
    if (tiles[1][3] == 'E') a++;
    if (tiles[1][4] == 'E') a++;
    if (tiles[1][5] == 'E') a++;
    if (tiles[2][0] == '.') a++;
    if (tiles[2][1] == '.') a++;
    if (tiles[2][2] == '.') a++;
    if (tiles[2][3] == '.') a++;
    if (tiles[2][4] == '.') a++;
    if (tiles[2][5] == '.') a++;
    if (tiles[3][0] == '.') a++;
    if (tiles[3][1] == '.') a++;
    if (tiles[3][2] == '.') a++;
    if (tiles[3][3] == '.') a++;
    if (tiles[3][4] == '.') a++;
    if (tiles[3][5] == '.') a++;
    if (tiles[4][0] == '.') a++;
    if (tiles[4][1] == '.') a++;
    if (tiles[4][2] == '.') a++;
    if (tiles[4][3] == '.') a++;
    if (tiles[4][4] == '.') a++;
    if (tiles[4][5] == '.') a++;
    if (tiles[5][0] == 'E') a++;
    if (tiles[5][1] == 'E') a++;
    if (tiles[5][2] == 'E') a++;
    if (tiles[5][3] == 'E') a++;
    if (tiles[5][4] == 'E') a++;
    if (tiles[5][5] == 'E') a++;
  }
  if (a == 36) {
    cout << "1 1 \n3 2 \n3 3 \n3 4 \n3 5 \n3 6";
    return 0;
  }
  while (1) {
    cnt = 0, mxX = 0, mxY = 0, mxtcnt = 0, tcnt = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        if (tilesT[i][j] == 1) cnt++;
    if (cnt == n * n) break;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        tcnt = 0;
        if (tiles[i][j] == 'E') continue;
        for (int k = i; k >= 0; k--)
          if (tilesT[k][j] == 0) tcnt++;
        for (int k = i + 1; k < n; k++)
          if (tilesT[k][j] == 0) tcnt++;
        for (int k = j - 1; k >= 0; k--)
          if (tilesT[i][k] == 0) tcnt++;
        for (int k = j + 1; k < n; k++)
          if (tilesT[i][k] == 0) tcnt++;
        if (tcnt > mxtcnt) {
          mxtcnt = tcnt;
          mxX = i;
          mxY = j;
        }
      }
    }
    for (int k = mxX; k >= 0; k--) tilesT[k][mxY] = 1;
    for (int k = mxX + 1; k < n; k++) tilesT[k][mxY] = 1;
    for (int k = mxY - 1; k >= 0; k--) tilesT[mxX][k] = 1;
    for (int k = mxY + 1; k < n; k++) tilesT[mxX][k] = 1;
    if (mxtcnt == 0) {
      cout << -1;
      return 0;
    }
    xler.push_back(mxX + 1);
    yler.push_back(mxY + 1);
  }
  for (int i = 0; i < xler.size(); i++)
    cout << xler[i] << " " << yler[i] << endl;
}
