#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 105;
char s[maxn][maxn];
int g[maxn][maxn];
int nx, ny, n;
bool vis[maxn];
int linkx[maxn];
bool dfs(int x) {
  for (int y = 1; y <= ny; ++y) {
    if (!vis[y] && g[x][y]) {
      vis[y] = 1;
      if (linkx[y] == -1 || dfs(linkx[y])) {
        linkx[y] = x;
        return true;
      }
    }
  }
  return false;
}
int maxMatch() {
  int ans = 0;
  memset(linkx, -1, sizeof(linkx));
  for (int x = 1; x <= nx; ++x) {
    memset(vis, 0, sizeof(vis));
    if (dfs(x)) ans++;
  }
  return ans;
}
int main() {
  while (cin >> n) {
    for (int i = 0; i < n; ++i) cin >> s[i];
    bool col = 0, row = 0;
    for (int i = 0; i < n; ++i) {
      bool tag = 0;
      for (int j = 0; j < n; ++j)
        if (s[i][j] == '.') {
          tag = 1;
          break;
        }
      if (tag == 0) {
        row = 1;
        break;
      }
    }
    for (int j = 0; j < n; ++j) {
      bool tag = 0;
      for (int i = 0; i < n; ++i)
        if (s[i][j] == '.') {
          tag = 1;
          break;
        }
      if (tag == 0) {
        col = 1;
        break;
      }
    }
    if (col == 1 && row == 1) {
      printf("-1\n");
      continue;
    }
    if (row == 0) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j)
          if (s[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
      }
    } else {
      for (int j = 0; j < n; ++j) {
        for (int i = 0; i < n; ++i)
          if (s[i][j] == '.') {
            printf("%d %d\n", i + 1, j + 1);
            break;
          }
      }
    }
  }
  return 0;
}
