Trans

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Bob is interested in popcount and some strange transforms. Currently, he is attacking the following problem:

There is an array of 2n2^n integers a_0,a_1,a_2,,a_2n1a\_0,a\_1,a\_2,\ldots,a\_{2^n-1}. The task is, for each ii (0i2n10 \le i \le 2^n-1), to calculate

b_i=_j=02n1(popcount(i,and,j)mod2)a_j,b\_i=\sum\limits\_{j=0}^{2^n-1} (\operatorname{popcount}(i \\, \operatorname{and} \\, j) \bmod 2) \cdot a\_j\text{,}

where "popcount(x)\operatorname{popcount}(x)" denotes the number of ones in the binary representation of xx, and "and\operatorname{and}" denotes the bitwise AND operation.

Although Bob is very smart, he still can't solve the problem fast. Can you help him calculate all b_ib\_i?

입력

The first line contains a single integer nn (1n201 \le n \le 20).

The second line contains 2n2^n integers describing the array aa (1a_i1091 \le a\_i \le 10^9).

출력

Print one line with 2n2^n integers, the ii-th of them being the value b_ib\_i.