Do you believe in dragons? Imagine that one of them wakes you up at night and asks the following:
Let's consider sequences of positive integers a=⟨a_1,a_2,…,a_k⟩.
Let f(a,x) be the number of occurrences of x in a. For example, f(⟨1,4,1,1⟩,1)=3.
Let c(y) be the number of ones in the binary expansion of y. For example, c(13)=c(1101_2)=3.
Let b(a)=∑_i∈ac(f(a,i)). For example, b(⟨1,4,1,1⟩)=c(3)+c(1)=2+1=3.
For the given value of n, find the maximum value of b(a) over all sequences with ∑_i=1ka_i=n.
What would you answer?
The first line of the input contains a single integer t (1≤t≤103) --- the number of test cases.
Each of the next t lines contains a single integer n (1≤n≤1018).
For each test case in order of input, output a single integer --- the answer to the problem.
In the first example test case, one possible sequence with b(a)=3 is a=⟨1,4,1,1⟩.