Changlong`s bother#3786

Changlong`s bother

10 seconds
16 megabytes
Easy

Changlong is a handsome and clever boy, and he is admired by many beautiful girls. Every day he receives tens of thousands of letters from girls who express their intense desire to be his life companion. You see, Changlong is very tired of this, and one day he gets an idea to avoid this bother. He declares:

Only those clever girls who can solve the problem below have the qualification to be his wife.

Changlong's problem can be formulated like this:

There is an interesting sequence of numbers a_1, a_2, \ldots, a_n. This sequence has a very attractive property: every number appears exactly times, except for a particular number , which occurs times. How can one extract this particular number from this sequence? In order to make this problem more mysterious, Changlong assumes that the involved numbers and are coprime, i.e., \gcd(p, q) = 1.

Changlong's method works very well. After his declaration, the number of received letters has decreased sufficiently. The girls begin to consider the problem with continuous and strenuous effort, but soon they find this problem is beyond their ability. Most of them give up, but there is still a beautiful girl who is persistent with this problem. One day this girl comes across you and she invites you to help her.

Input

The first line of the input contains an integer (0 < k \leq 100), the number of test cases.

For each test case, there will be a line containing three integers: (0 < n \leq 10^7), , (1 < p, q < 200, \gcd(p, q) = 1), and a line containing elements a_i (0 < a_i < 10^7) of the sequence.

Output

For each test case, you should first output a line with "Case #:", where # is the id of the test case; then you should output the particular number , i.e., the number which occurs times in the sequence.

Examples

Example 1

Loading
Loading