AND

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

문제

You had an array aa. After that, you calculated bitwise ANDs of all subarrays of the original array. Formally, you calculated all numbers of the form a_ia\_i AND a_i+1a\_{i + 1} AND \ldots AND a_ja\_j for 1ijlength(a)1 \le i \le j \le \mathrm{length}(a).

You remember the resulting set of all these numbers: a number lies in this set if and only if it can be represented as bitwise AND of at least one subarray. Sadly, you forgot the original array.

Find any array aa which would produce the given set of ANDs on subarrays, or determine that there is no such array.

입력

The first line contains a single integer tt (1t1051 \le t \le 10^5), the number of test cases.

The first line of each test case contains a single integer nn (1n1051 \le n \le 10^5), the size of the given set.

The second line of each test case contains nn integers b_1,b_2,,b_nb\_1, b\_2, \ldots, b\_n (0b_i22010 \le b\_i \le 2^{20} - 1), the elements of the set. It is guaranteed that all elements are distinct.

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5.

출력

For each test case, if there is no such array, output 1-1.

Otherwise, on the first line, output the size of the original array kk (1k5n1 \le k \le 5n).

On the next line, output kk integers a_1,a_2,,a_ka\_1, a\_2, \ldots, a\_k (0a_i22010 \le a\_i \le 2^{20} - 1), the elements of the array.

If there are several possible answers, print any one of them.

It can be shown that, if there is at least one array, then there is an array which satisfies these conditions.

힌트

Note that the elements of the array that you output don't have to be distinct.