Problem: Example

Input

2 1
WE


Output

1 2

Solution (in CPP):

Solution:
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n, m;
    cin >> n >> m;
    vector<string> s(m);
    REP(i,m) cin >> s[i];
    int ans = 0, mi = 0, x = 0;
    REP(j,n){
        REP(i,m){
            if (s[i][j] == 'W') x--;
            else x++;
        }
        if (x < mi){
            mi = x;
            ans = j+1;
        }
    }

    printf("%d %d\n", ans, ans+1);

    return 0;
}