Time limit: 1s
Memory limit: 64MB
Input:
Output:
Task
Initially, there was a sequence of natural numbers between and , where is of the form . This sequence was lost, and all that remains is a sequence of size defined as follows: , where represents the bitwise AND operation. More precisely, is the number of elements for which . You are given the sequence and are asked to find a possible initial sequence.
Input data
On the first line, the numbers and are given. On the second line, the sequence (indexed from ) is given.
Output data
A sequence of numbers between and with the significance described in the statement, or if no such sequence exists.
Constraints and clarifications
- ;
- is indexed from .
- Any correct solution is accepted.
- For points, .
Example 1
stdin
2 3
2 0 2
stdout
1 1
Explanation
This is the only possible sequence.
Example 2
stdin
1 1
0
stdout
-1
Explanation
There is no such sequence.