import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.TreeSet; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int x = Integer.parseInt(sa[1]); sa = br.readLine().split(" "); long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); for (int i = 0; i < n; i++) { int[] dp = new int[n]; for (int r = i + 1; r < n; r++) { TreeSet set = new TreeSet<>(); long sum = a[r]; for (int k = r - 1; k >= i; k--) { if (k == i) { set.add(0); break; } sum += a[k]; set.add(dp[k]); if (sum > x) { break; } } for (int j = 0; j < n; j++) { if (!set.contains(j)) { dp[r] = j; break; } } } for (int r = i - 1; r >= 0; r--) { TreeSet set = new TreeSet<>(); long sum = a[r]; for (int k = r + 1; k <= i; k++) { if (k == i) { set.add(0); break; } sum += a[k]; set.add(dp[k]); if (sum > x) { break; } } for (int j = 0; j < n; j++) { if (!set.contains(j)) { dp[r] = j; break; } } } if (dp[0] != dp[n - 1]) { System.out.println("A"); return; } } System.out.println("B"); } }