Time Limit: 2 s
Memory Limit: 64 MB

Submission：55
AC：21
Score：98.76

YiYi is a smart boy, he is fascinated in solving eccentric problems. One day when he was reading a book, he came across a very interesting problem. After a few time’s thinking, he finally get the solution. YiYi considers this solution very heuristic, now he decides to show this problem to you so that you can also enjoy the happiness of solving this interesting problem. Here is the description of the problem:

Suppose at first you have a sequence, S_{1}, consists of two numbers: 1, 1. According to some rule you can get the sequence S_{n} from the sequence S_{n-1}.Once you get S_{n-1}, you will be asked to insert one n between a and b if a and b are two adjacent numbers in S_{n-1} and a + b = n. After you have inserted all possible n you finally get S_{n}. You can also get the sequence S_{n+1} using the same method and so on.

Here the question comes: give you n, you will be asked to output the number of n in S_{n}. For example if n = 5, you will output 4 since there are 4 5s in S_{5}.

The first line of the input contains a number k, the number of test cases to solve (1 ≤ k ≤ 200). Each test case consists of a single integer 2 ≤ n ≤ 10^{10} on a separate line.

For each test case, you are asked to output the number of n in S_{n} on a line.

input

3
2
4
5

output

1
2
4