Problems
Lately, the cows on Farmer John's farm have been infatuated with watching the show Apothecowry Dairies. The show revolves around a clever bovine sleuth CowCow solving problems of various kinds. Bessie found a new problem from the show, but the solution won't be revealed until the next episode in a week! Please solve the problem for her.
You are given integers
1 \le N \le 100 a_1 + a_2 + \dots + a_N = M \text{popcount}(a_1) \oplus \text{ popcount}(a_2) \oplus \dots \oplus \text{ popcount}(a_N) = K
If no such sequence exists, print
The input will consist of
Input
The first line contains an integer
Each of the following
Output
On the first line, a single integer
On the second line,
Example
3
2 1
33 5
10 5
2
2 0
3
3 23 7
-1
In the first test case, the elements in the array
In the second test case, the elements in the array
Other valid arrays are
It can be shown that no valid arrays exist for the third test case.