#include #include #include using namespace std; int N,K,T; bool solve(string C,int K,int T) { bool win=false; bool fn=false; for(int t=0;t<2;t++) { int l=K; while(l>=0&&C[K]==C[l])l--; if(l>=0&&(K-l)%2==T%2&&K-l<=T)win=true; reverse(C.begin(),C.end()); K=N-1-K; if(K-l>=2)fn=true; } if(fn)return win^(C[K]=='B'); else return C[K]=='B'; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>K>>T; string C;cin>>C; K--; bool win; if(T%2==0)win=solve(C,K,T); else { int ex=0; if(K>0)ex|=1<