Fortune Telling codeforces solution

Your friends Alice and Bob practice fortune telling.

Fortune telling is performed as follows. There is a well-known array 𝑎a of 𝑛n non-negative integers indexed from 11 to 𝑛n. The tellee starts with some non-negative number 𝑑d and performs one of the two operations for each 𝑖=1,2,,𝑛i=1,2,…,nin the increasing order of 𝑖i. The possible operations are:

  • replace their current number 𝑑d with 𝑑+𝑎𝑖d+ai
  • replace their current number 𝑑d with 𝑑𝑎𝑖d⊕ai (hereinafter  denotes the bitwise XOR operation)

Notice that the chosen operation may be different for different 𝑖i and for different tellees.

One time, Alice decided to start with 𝑑=𝑥d=x and Bob started with 𝑑=𝑥+3d=x+3. Each of them performed fortune telling and got a particular number in the end. Notice that the friends chose operations independently of each other, that is, they could apply different operations for the same 𝑖i.

You learnt that either Alice or Bob ended up with number 𝑦y in the end, but you don’t know whose of the two it was. Given the numbers Alice and Bob started with and 𝑦y, find out who (Alice or Bob) could get the number 𝑦y after performing the operations. It is guaranteed that on the jury tests, exactly one of your friends could have actually gotten that number.

Hacks

You cannot make hacks in this problem.

Input

On the first line of the input, you are given one number 𝑡t (1𝑡1041≤t≤104) — the number of test cases. The following 2𝑡2⋅t lines contain test cases.

The first line of each test case contains three numbers 𝑛n𝑥x𝑦y (1𝑛1051≤n≤1050𝑥1090≤x≤1090𝑦10150≤y≤1015) — the length of array 𝑎a, Alice’s initial number (Bob’s initial number is therefore 𝑥+3x+3), and the number that one of the two friends got in the end.

The second line of each test case contains 𝑛n numbers — the array 𝑎a (0𝑎𝑖1090≤ai≤109).

It is guaranteed that the sum of 𝑛n over all test cases does not exceed 105105.

Output

For each test case, print the name of the friend who could get the number 𝑦y: “Alice” or “Bob”.

Example
input

Copy
4
1 7 9
2
2 0 2
1 3
4 0 1
1 2 3 4
2 1000000000 3000000000
1000000000 1000000000
output

Copy
Alice
Alice
Bob
Alice
Note

In the first test case, Alice could get 99 using the following operations: 7+2=97+2=9.

In the second test case, Alice could get 22 using this operations: (0+1)3=2(0+1)⊕3=2.

In the third test case, Bob started with 𝑥+3=0+3=3x+3=0+3=3 and could get 11 this way: (((3+1)+2)3)4=1(((3+1)+2)⊕3)⊕4=1.

Leave a Comment