Tribute
The Son of Heaven, our beloved emperor, has commanded you, his First Minister, to extort tribute from n neighbouring kingdoms. Each of the tributaries has been assigned a number of silver coins to pay - for the i-th kingdom, the number is a[i]
. To show His infinite grace, the emperor decided to only take money from some of the countries, sparing the rest. Your overzealous finance minister, after writing down all a[i]
's, has already produced all possible 2^n
- 1 income values - the sums of the non-empty subsets of tributaries. Unfortunately, the minister lost the paper sheet with original tribute values in the process. For this infraction, as well as improper calligraphy, he was promptly executed.
Now you only have 2^n
- 1 sums, written rather badly. Can you recover the tribute values from them?
Input
The first line contains the number of test cases z (1 ≤ z ≤ 200). The descriptions of the testcases follow.
Every test case consists of two lines: the first contains a number n (1 ≤ n ≤ 20), the second - 2^n
- 1 integers not exceeding 2 * 109
, denoting all the possible sums of tributes. Assume that the tribute values were all positive integers. The total number of sums in all test cases does not exceed 10^7
.
Output
For each test case output the recovered values of a[i]
for i = 1, 2, .., n, in increasing order. If there are no values that fit the input, or if there are multiple possibilities, simply write "NO" instead - you cannot execute anyone twice.