#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int a[maxn][maxn], ar[maxn][maxn], n;
vector<int> printres;
int dfs(int bitm, int vert) {
  if (bitm == (1 << n) - 1) {
    return 1;
  }
  if (vert == n - 1) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (a[vert][i] == 1 && (bitm & (1 << i)) == 0) {
      printres.push_back(i);
      if (dfs(bitm | (1 << i), vert + 1)) {
        return 1;
      }
      printres.pop_back();
    }
  }
  return 0;
}
int dfsr(int bitm, int vert) {
  if (bitm == (1 << n) - 1) {
    return 1;
  }
  if (vert == n - 1) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (ar[vert][i] == 1 && (bitm & (1 << i)) == 0) {
      printres.push_back(i);
      if (dfs(bitm | (1 << i), vert + 1)) {
        return 1;
      }
      printres.pop_back();
    }
  }
  return 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string st;
    cin >> st;
    for (int j = 0; j < n; ++j) {
      if (st[j] == '.') {
        a[i][j] = 1;
        ar[j][i] = 1;
      } else {
        a[i][j] = 0;
        ar[j][i] = 0;
      }
    }
  }
  int res = -1, flagn = 1;
  for (int i = 0; i < n; ++i) {
    int flag = 1;
    for (int j = 0; j < n; ++j) {
      if (a[i][j] == 1) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      flagn = 0;
      break;
    }
  }
  if (flagn == 1) {
    res = n;
  }
  int flagnr = 1;
  for (int j = 0; j < n; ++j) {
    int flag = 1;
    for (int i = 0; i < n; ++i) {
      if (a[i][j] == 1) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      flagnr = 0;
      break;
    }
  }
  if (flagnr == 1) {
    res = n;
  }
  if (flagn) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (a[i][j] == 1) {
          cout << i + 1 << " " << j + 1 << endl;
          break;
        }
      }
    }
  } else if (flagnr) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (a[j][i] == 1) {
          cout << j + 1 << " " << i + 1 << endl;
          break;
        }
      }
    }
  } else {
    cout << -1 << endl;
  }
  return 0;
}
