#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000000 int main(){ int N,X; cin>>N>>X; vector a(N); for(int i=0;i>a[i]; } vector> dp(N,vector (N,true)); for(int i=0;i=N)break; int sum = 0; bool now = true; while(true){ sum += a[l]; if(sum>X)break; l++; if(l>r)break; now &= dp[l][r]; if(!now)break; } l = j; r = j+i; sum = 0; while(true){ sum += a[r]; if(sum>X)break; r--; if(l>r)break; now &= dp[l][r]; if(!now)break; } dp[j][j+i]=!now; } } if(!dp[0][N-1]){ cout<<"B"<