#Lutece1471. Alice and Bob are playing number

Alice and Bob are playing number

Migrated from Lutece 1471 Alice and Bob are playing number

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

-Bob and his girl friend are playing game together.This game is like this:

There are nn numbers.

If op = 11,Bob wants to find two numbers aia_i and aja_j,that aia_i & aja_j will become maximum value.

If op = 22,Bob wants to find two numbers aia_i and aja_j,that aia_i ^ aja_j will become maximum value.

If op = 33,Bob wants to find two numbers aia_i and aja_j,that aia_i | aja_j will become maximum value.

Notice:

& for bitwise AND. (4 & 2) is 0, (4 & 5) is 4.

^ for bitwise XOR. (4 ^ 2) is 6, (4 ^ 5) is 1.

| for bitwise OR . (4 | 2) is 6, (4 | 5) is 5.

Input

-First line is a positive integer TT , represents there are TT test cases.

For each test case:

First line includes two numbers n(2??n??100000)op(1??op??3)n (2 ?\leq?n?\leq?100000),op( 1?\leq?op?\leq?3).

The next line contains nn numbers: a1,a2,,an(1??ai??1000000)a_1, a_2 ,… , a_n (1?\leq?a_i?\leq?1000000).

Output

-For the ii-th test case , first output Case #i: in a single line.

Then output the answer of ii-th test case.

Samples

3
2 1
4 2
2 2
4 2
2 3
4 2
Case #1: 0
Case #2: 6
Case #3: 6

Resources

“玲珑杯”ACM比赛 Round #2