#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 left(N),right(N); int l = 0; int r = 0; int sum = 0; while(true){ while(r != N && sum + a[r] <= X){ sum += a[r]; r++; } left[l] = r-l; sum -= a[l]; l++; if(l==N)break; } l=N-1; r=N-1; sum=0; while(true){ while(l!=-1&&sum+a[l]<=X){ sum += a[l]; l--; } right[r] = r-l; sum -= a[r]; r--; if(r<0)break; } vector> dp(N,vector (N,true)); for(int i=0;i=N)break; bool f = false; for(int k=0;kmin(i,right[j]);k++){ if(!dp[l][r-k-1]){ f=true; break; } } } dp[j][j+i]=f; } } if(!dp[0][N-1]){ cout<<"B"<