Score : $600$ points
Construct a sequence $a$ = {$a_1,\ a_2,\ ...,\ a_{2^{M + 1}}$} of length $2^{M + 1}$ that satisfies the following conditions, if such a sequence exists.
What is xor (bitwise exclusive or)?
The xor of integers $c_1, c_2, ..., c_n$ is defined as follows:
For example, $3 \ xor \ 5 = 6$. (If we write it in base two: 011
$xor$ 101
$=$ 110
.)
Input is given from Standard Input in the following format:
$M$ $K$
If there is no sequence $a$ that satisfies the condition, print -1
.
If there exists such a sequence $a$, print the elements of one such sequence $a$ with spaces in between.
If there are multiple sequences that satisfies the condition, any of them will be accepted.
1 0
0 0 1 1
For this case, there are multiple sequences that satisfy the condition.
For example, when $a$ = {$0, 0, 1, 1$}, there are two pairs $(i,\ j)\ (i < j)$ such that $a_i = a_j$: $(1, 2)$ and $(3, 4)$. Since $a_1 \ xor \ a_2 = 0$ and $a_3 \ xor \ a_4 = 0$, this sequence $a$ satisfies the condition.
1 1
-1
No sequence satisfies the condition.
5 58
-1
No sequence satisfies the condition.