#include<bits/stdc++.h>
#define MOD 1000000007
#define EPS 1e-15
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define endl '\n'
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
const ld PI=3.141592653589793238L;
const ll N=100005;
using namespace std;
ll n;
ll r[1000],c[1000];
ll C[1000][1000];
int main(){
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// <<>>
cin>>n;
ll t[n][n];
char ch;
for(int i=0;i<n;++i) for(int j=0;j<n;++j) cin>>ch,t[i][j]=(ch=='B');
for(int i=0;i<n;++i) for(int j=0;j<n;++j) if(!t[i][j]) ++r[i],++c[j],++C[i][j];
vector<pair<ll,ll> >v1,v2;
for(int i=0;i<n;++i) for(int j=0;j<n;++j){
C[i][j]+=r[i]+c[j];
if(C[i][j]&1) v1.pb(mp(i,j));
else v2.pb(mp(i,j));
}
if(v2.size()<v1.size()) swap(v1,v2);
cout<<v1.size()<<endl;
for(int i=0;i<v1.size();++i) cout<<v1[i].first+1<<' '<<v1[i].second+1<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIEVQUyAxZS0xNQojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIGxkIGxvbmcgZG91YmxlCiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgZW5kbCAnXG4nCiNkZWZpbmUgZm9yZWFjaChpdCx4KSBmb3IoX190eXBlb2ZfXygoeCkuYmVnaW4oKSkgaXQgPSAoeCkuYmVnaW4oKTsgaXQgIT0gKHgpLmVuZCgpOyArK2l0KQpjb25zdCBsZCBQST0zLjE0MTU5MjY1MzU4OTc5MzIzOEw7CmNvbnN0IGxsIE49MTAwMDA1Owp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbGwgbjsKbGwgclsxMDAwXSxjWzEw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