Bob is interested in popcount and some strange transforms. Currently, he is attacking the following problem:
There is an array of 2n integers a_0,a_1,a_2,…,a_2n−1. The task is, for each i (0≤i≤2n−1), to calculate
b_i=∑_j=02n−1(popcount(i,and,j)mod2)⋅a_j,
where "popcount(x)" denotes the number of ones in the binary representation of x, and "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_i?
The first line contains a single integer n (1≤n≤20).
The second line contains 2n integers describing the array a (1≤a_i≤109).
Print one line with 2n integers, the i-th of them being the value b_i.