336_C. Vasily the Bear and Sequence
Vasily the bear has got a sequence of positive integers a1, a2, ..., an. Vasily the Bear wants to write out several numbers on a piece of paper so that the beauty of the numbers he wrote out was maximum. 

The beauty of the written out numbers b1, b2, ..., bk is such maximum non-negative integer v, that number b1 and b2 and ... and bk is divisible by number 2v without a remainder. If such number v doesn't exist (that is, for any non-negative integer v, number b1 and b2 and ... and bk is divisible by 2v without a remainder), the beauty of the written out numbers equals -1. 

Tell the bear which numbers he should write out so that the beauty of the written out numbers is maximum. If there are multiple ways to write out the numbers, you need to choose the one where the bear writes out as many numbers as possible.

Here expression x and y means applying the bitwise AND operation to numbers x and y. In programming languages C++ and Java this operation is represented by "&", in Pascal — by "and".

Input

The first line contains integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ a1 < a2 < ... < an ≤ 109).

Output

In the first line print a single integer k (k > 0), showing how many numbers to write out. In the second line print k integers b1, b2, ..., bk — the numbers to write out. You are allowed to print numbers b1, b2, ..., bk in any order, but all of them must be distinct. If there are multiple ways to write out the numbers, choose the one with the maximum number of numbers to write out. If there still are multiple ways, you are allowed to print any of them.

Examples

Input

5
1 2 3 4 5


Output

2
4 5


Input

3
1 2 4


Output

1
4
```python
from sys import stdin,stdout
nmbr = lambda: int(stdin.readline())
lst = lambda: list(map(int,stdin.readline().split()))
for _ in range(1):#nmbr()):
    n=nmbr()
    a=lst()
    bits=[[0 for _ in range(34)] for _ in range(n)]
    for i in range(n):
        for j in range(34):
            bits[i][33-j]=(a[i]>>j)&1
    # print(*bits,sep='\n')
    bit=-1
    x=(1<<32)-1
    for bp in range(34):
        nd=x
        for i in range(n):
            if bits[i][33-bp]:
                nd&=a[i]
        if nd%(1<<bp)==0:
            bit=bp
    if bit==-1:
        print(-1)
    else:
        ans=[]
        for i in range(n):
            if bits[i][33-bit]:
                ans+=[a[i]]
        print(len(ans))
        print(*ans)
```