시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB1110990.000%

문제

Yuta has a sequence of $n$ positive integers $A_1, \ldots, A_n$, and their sum is $m$. For each subsequence $S$ of $A$, he calculated the sum of elements in this subsequence.

So, now Yuta has also got $2^n$ integers between $0$ and $m$. For each $i \in [0, m]$, let $B_i$ be the number of integers $i$ he got.

Yuta shows you the array $B_i$, and he asks you to restore $A_1, \ldots, A_n$. If there are several possibilities, find the lexicographically smallest possible sequence.

입력

The first line of the input contains two integers $n$ and $m$ ($1 \leq n \leq 50$, $1 \leq m \leq 10^4$).

The second line contains $m + 1$ integers $B_0, \ldots, B_m$ ($0 \leq B_i \leq 2^n$).

출력

Print a single line with $n$ integers $A_1, \ldots, A_n$.

It is guaranteed that there exists at least one solution. And if there are several possible solutions, print the lexicographically smallest one.

예제 입력 1

2 3
1 1 1 1

예제 출력 1

1 2

예제 입력 2

3 3
1 3 3 1

예제 출력 2

1 1 1

힌트

In the first example, $A$ is $[1, 2]$. $A$ has four subsequences $[]$, $[1]$, $[2]$ and $[1,2]$, and the sums for them are $0$, $1$, $2$ and $3$. So, $B = [1, 1, 1, 1]$.