#include <bits/stdc++.h>
using namespace std;
const int maxn = 121;
int n, m, sum;
vector<int> v, q;
char ww[maxn][maxn];
void printa(vector<pair<int, int> > ans) {
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].first << " " << ans[i].second << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) cin >> ww[i][j];
  vector<pair<int, int> > ans;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (ww[i][j] != 'E') {
        ans.push_back({i, j});
        break;
      }
  if (ans.size() == n) {
    printa(ans);
    return 0;
  }
  ans.clear();
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (ww[j][i] != 'E') {
        ans.push_back({j, i});
        break;
      }
  if (ans.size() == n) {
    printa(ans);
    return 0;
  }
  cout << "-1" << '\n';
}
