#include <bits/stdc++.h>
using namespace std;
int main()
{
int n=0;
cin>>n;
vector<string> v(n);
for (int i=0;i<n;i++) {
cin>>v[i];
}
vector<int> pos(n,-1);
for (int i=0;i<n;i++) {
for (int j=0;j<n;j++) {
if (v[i][j]=='.') {
pos[i]=j;
}
}
}
for (int i=0;i<n;i++) {
if (pos[i]==-1) {
cout<<-1<<endl;
exit(0);
}
}
for (int i=0;i<n;i++) {
cout<<i+1<<" "<<pos[i]+1<<endl;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgaW50IG49MDsKICBjaW4+Pm47CiAgdmVjdG9yPHN0cmluZz4gdihuKTsKICBmb3IgKGludCBpPTA7aTxuO2krKykgewogICAgY2luPj52W2ldOwogIH0KICB2ZWN0b3I8aW50PiBwb3MobiwtMSk7CiAgZm9yIChpbnQgaT0wO2k8bjtpKyspIHsKICAgIGZvciAoaW50IGo9MDtqPG47aisrKSB7CiAgICAgIGlmICh2W2ldW2pdPT0nLicpIHsKICAgIHBvc1tpXT1qOwogICAgICB9CiAgICB9CiAgfQogIGZvciAoaW50IGk9MDtpPG47aSsrKSB7CiAgICBpZiAocG9zW2ldPT0tMSkgewogICAgICBjb3V0PDwtMTw8ZW5kbDsKICAgICAgZXhpdCgwKTsKICAgIH0KICB9CiAgZm9yIChpbnQgaT0wO2k8bjtpKyspIHsKICAgIGNvdXQ8PGkrMTw8IiAiPDxwb3NbaV0rMTw8ZW5kbDsKICB9Cn0=