import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); int[] cals = new int[n]; for (int i = 0; i < n; i++) { cals[i] = sc.nextInt(); } boolean[][] dp = new boolean[n][n]; for (int i = 1; i < n; i++) { for (int j = 0; j + i < n; j++) { int sum = 0; for (int k = j; !dp[j][j + i]; k++) { sum += cals[k]; if (sum > x) { break; } dp[j][j + i] = !dp[k + 1][j + i]; } sum = 0; for (int k = j + i; !dp[j][j + i]; k--) { sum += cals[k]; if (sum > x) { break; } dp[j][j + i] = !dp[j][k - 1]; } } } if (dp[0][n - 1]) { System.out.println("A"); } else { System.out.println("B"); } } }