#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
#define MAXL 1002
int n, count1;
vector<ii> pos0;
vector<ii> pos1;
bool ans[MAXL][MAXL];
void turn(int l, int c)
{
for (int j = 1; j <= n; j++) {
if (ans[l][j])
ans[l][j] = 0;
else
ans[l][j] = 1;
}
for (int i = 1; i <= n; i++) {
if (i != l) {
if (ans[i][c])
ans[i][c] = 0;
else
ans[i][c] = 1;
}
}
}
int main()
{
scanf("%d", &n);
char line[MAXL];
for (int i = 1; i <= n; i++) {
scanf(" %s", line);
for (int j = 0; j < strlen(line); j++) {
if (line[j] == 'W') {
pos1.push_back(make_pair(i, j + 1));
count1++;
}
else
pos0.push_back(make_pair(i, j + 1));
}
}
if (count1 <= (n * n) / 2) {
for (int i = 0; i < pos1.size(); i++)
turn(pos1[i].first, pos1[i].second);
}
else {
for (int i = 0; i < pos0.size(); i++)
turn(pos0[i].first, pos0[i].second);
}
int tam = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (ans[i][j])
tam++;
}
}
if (tam <= (n * n) / 2) {
printf("%d\n", tam);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (ans[i][j])
printf("%d %d\n", i, j);
}
}
}
else {
printf("%d\n", n * n - tam);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (!ans[i][j])
printf("%d %d\n", i, j);
}
}
}
return 0;
}