SP18336 BIT2 - Search Bit Sum

Description

Deepan is a palantir incredible guy who once had a trip in Switzerland. He saw a weird shop where he liked a teddy. But he din have enough dollars with him to buy this teddy. But there was a scheme ongoing like solve a equation and get the teddy && pay whatever we wish.Thats why this shop is weirdo. He had no eager to buy this teddy as not much of people can solve the equation, so he was sure he can get this teddy as soon as he solve the problem. He need your help to solve the equation. You will be given a number N, and you have to tell whether there exist a number K so that sum of BITS in all the numbers from 1 to K is equal to N. If there exist a K, then print it, else print "Does Not Exist." without quotes.

Input Format

First line contains t, number of testcases. For each testcase, first line contains N.

Output Format

Output as described above.