P10642 [HackerEarth] just find the next number
普及
题目描述

You are given an integer n find its next greater or equal number whose binary representation must not contain consecutive ones.

For eg. given n=6 whose binary is 110 and the next number with no consecutive ones is 8 whose binary is 1000.

INPUT

First line of input contains t, the total number of test cases. Then t line follows n.

0<t<100

0<n<10^5

OUTPUT

The next number on each line.

SAMPLE INPUT
2
6
2

SAMPLE OUTPUT
8
2

输入格式

见题面

输出格式

见题面

样例输入
2 6 2 SAMPLE
样例输出
8 2