Jett is tired after destroying the town and she wants to have a rest. She likes high places, that's why for having a rest she wants to get high and she decided to craft staircases.

A staircase is a squared figure that consists of square cells. Each staircase consists of an arbitrary number of stairs. If a staircase has $n$ stairs, then it is made of $n$ columns, the first column is $1$ cell high, the second column is $2$ cells high, $\ldots$, the $n$-th column if $n$ cells high. The lowest cells of all stairs must be in the same row.

A staircase with $n$ stairs is called nice, if it may be covered by $n$ disjoint squares made of cells. All squares should fully consist of cells of a staircase. This is how a nice covered staircase with $7$ stairs looks like: [Image] 

Find out the maximal number of different nice staircases, that can be built, using no more than $x$ cells, in total. No cell can be used more than once.


-----Input-----

The first line contains a single integer $t$ $(1 \le t \le 1000)$  — the number of test cases.

The description of each test case contains a single integer $x$ $(1 \le x \le 10^{18})$  — the number of cells for building staircases.


-----Output-----

For each test case output a single integer  — the number of different nice staircases, that can be built, using not more than $x$ cells, in total.


-----Example-----
Input
4
1
8
6
1000000000000000000

Output
1
2
1
30



-----Note-----

In the first test case, it is possible to build only one staircase, that consists of $1$ stair. It's nice. That's why the answer is $1$.

In the second test case, it is possible to build two different nice staircases: one consists of $1$ stair, and another consists of $3$ stairs. This will cost $7$ cells. In this case, there is one cell left, but it is not possible to use it for building any nice staircases, that have not been built yet. That's why the answer is $2$.

In the third test case, it is possible to build only one of two nice staircases: with $1$ stair or with $3$ stairs. In the first case, there will be $5$ cells left, that may be used only to build a staircase with $2$ stairs. This staircase is not nice, and Jett only builds nice staircases. That's why in this case the answer is $1$. If Jett builds a staircase with $3$ stairs, then there are no more cells left, so the answer is $1$ again.

Starter code:

Solutions:
import sys
import random
from fractions import Fraction
from math import *
 
def input():
    return sys.stdin.readline().strip()
 
def iinput():
    return int(input())

def finput():
    return float(input())

def tinput():
    return input().split()

def linput():
    return list(input())
 
def rinput():
    return list(map(int, tinput()))

def fiinput():
    return list(map(float, tinput()))
 
def rlinput():
    return list(map(int, input().split()))
def trinput():
    return tuple(rinput())

def srlinput():
    return sorted(list(map(int, input().split())))

def NOYES(fl):
    if fl:
        print("NO")
    else:
        print("YES")
def YESNO(fl):
    if fl:
        print("YES")
    else:
        print("NO")
    
def main():
    n = iinput()
    #k = iinput() 
    #m = iinput() 
    #n = int(sys.stdin.readline().strip()) 
    #n, k = rinput()
    #n, m = rinput()
    #m, k = rinput()
    #n, k, m = rinput()
    #n, m, k = rinput()
    #k, n, m = rinput()
    #k, m, n = rinput() 
    #m, k, n = rinput()
    #m, n, k = rinput()
    #q = srlinput()
    #q = linput()
    s, t, res = 1, 1, 0
    while s <= n:
        res += 1
        n -= s
        t = 2 * t + 1
        s = (t * (t + 1)) // 2
    print(res)
        
    
                
    
    
    
            
    
        
    

for i in range(iinput()):
    main()


for _ in [0]*int(input()):
 n=int(input());o=0;c=1
 while n >= 0:
  n-=c*(c+1)//2;o+=1;c=2*c+1
 print(o-1)

tests = int(input())
for test in range(tests):
    n = int(input())
    ans = 0
    s = 0
    for i in range(1, 31):
        d = 2 ** i - 1
        r = d * (d + 1) // 2
        if s + r <= n:
            ans += 1
            s += r
        else:
            break
    print(ans)
        


t = int(input())
for _ in range(t):
  x = int(input())
  ans = 0
  size = 1
  temp = (size*(size+1))//2
  while x >= temp:
    ans += 1
    x -= temp
    size = 2*size + 1
    temp = (size*(size+1))//2
  print(ans)


q = int(input())
for _ in range(q):
    n = int(input())
    wyn = 0
    pot = 1
    total = 1
    while total <= n:
        wyn += 1
        pot += 1
        total += (2**pot-1)*(2**pot)//2
    print(wyn)

for _ in range(int(input())):
    n = int(input())

    i = 1
    have = 0
    ans = 0
    while have + i * (i + 1) // 2 <= n:
        have += i * (i + 1) // 2
        ans += 1
        i = i * 2 + 1

    print(ans)


from bisect import bisect_left,bisect_right
a=[1]
f=1
while a[-1]<=10**18:
  f=f*2+1
  a.append(a[-1]+f*(f+1)//2)
for _ in range(int(input())):
  n=int(input())
  print(bisect_right(a,n))

import bisect
p2 = [2 ** n - 1 for n in range(32)]
p2 = [x * (x + 1) // 2 for x in p2]
for i in range(1, 32):
    p2[i] += p2[i - 1]
for _ in range(int(input())):
    n = int(input())
    print(bisect.bisect_right(p2, n) - 1)


for _ in range(int(input())):
	ans=0
	n=int(input())
	cp=1
	while cp*(cp+1)//2<=n:
		ans+=1
		n-=cp*(cp+1)//2
		cp=cp*2+1
	print(ans)

y=lambda:int(input())
for _ in range(y()):
 n=y();c=0
 while 2**(2*c+1)-2**c<=n:n-=2**(2*c+1)-2**c;c+=1
 print(c)

l=[]
i=1
while(i<10**18+5):
    l.append((i*(i+1))//2)
    i=i*2+1
t=int(input())
for you in range(t):
    n=int(input())
    count=0
    sum=0
    for i in range(len(l)):
        sum+=l[i]
        if(sum>n):
            break
    print(i)


from bisect import bisect_right
t = int(input())
a = []
s = 0
x = 2
while s <= 10 ** 18:
    s += x * (x - 1) // 2
    a.append(s)
    x *= 2
for _ in range(t):
    print(bisect_right(a, int(input())))


nice = [1]
while nice[-1] <= 10**18:
    nice.append((nice[-1]<<1)+1)
for i in range(len(nice)):
    nice[i] = nice[i] * (nice[i] + 1) // 2

t = int(input())
for _ in range(t):
    x = int(input())
    i = 0
    num = 0
    while x > 0 and i < len(nice):
        if x >= nice[i]:
            x -= nice[i]
            num += 1
        i += 1
    print(num)

T = int(input())

def need(n):
    return (n*(n+1))//2

for t in range(T):
    x = int(input())
    ans = 0
    nxt = 1
    while True:
        if x < need(nxt):
            break
        ans+=1
        x -= need(nxt)
        nxt = nxt*2+1
    print(ans)

from math import log2
for _ in range(int(input())):
    x = int(input())
    acc = 0
    for i in range(1, 60):
        acc += (2**i-1) * (2**(i-1))
        if acc > x:
            break
    print(i-1)


import sys
input = sys.stdin.readline

T = int(input())

for t in range(T):
    X = int(input())
    answer = 0
    pow2 = 1

    while True:
        r = 2**pow2 - 1
        needed = r*(r+1) // 2
        if needed <= X:
            answer += 1
            X -= needed
        else:
            break
        pow2 += 1

    print(answer)


for _ in range(int(input())):
    n = int(input())
    i = 1
    while True:
        x = pow(2,i-1)*(pow(2,i)-1)
        if n < x:
            break
        n -= x
        i += 1
    print(i-1)

gans = []
for _ in range(int(input())):
    n = int(input())
    ans = 0
    cur = 1
    while n >= cur * (cur + 1) // 2:
        n -= cur * (cur + 1) // 2
        ans += 1
        cur = cur * 2 + 1
        #print(cur, n)
    gans.append(ans)
print('\n'.join(map(str, gans)))


arr=[]
s=1
i=1
while s<((10**18)+1):
    temp=(s*(s+1))//2
    arr.append(temp)
    s+=(2**i)
    i+=1
t=int(input())
for i in range(t):
    x=int(input())
    ans=0
    j=0
    while x>0:
        if arr[j]<=x:
            x-=arr[j]
            ans+=1
        else:
            x=0
        j+=1
    print(ans)

l = [1]
for i in range(70):
    l.append(2*l[-1] + 1)
# print(l[-1])
l = [(ll * (ll+1))//2 for ll in l]
lll = [l[0]]
for i in range(1, 70):
    lll.append(lll[-1] + l[i])
l = lll

for t in range(int(input())):
    n = int(input())
    for i in range(70):
        if l[i] > n:
            print(i)
            break

t = int(input())

j = 0
r  = 0
R = []
for i in range(10**5):
    j = 2*j+1
    s = j*(j+1)//2
    r += s
    R.append(r)
    if r > 10**18:
        break

import bisect

for _ in range(t):
    x = int(input())
    i = bisect.bisect_right(R, x)
    print(i)


A = [1]
s = 1
for i in range(32):
    s *= 4
    A.append(A[-1] * 2 + s)
S = [0] * 33
for i in range(32):
    S[i+1] = S[i] + A[i]
T = int(input())
for _ in range(T):
    N = int(input())
    for i in range(33):
        if S[i] > N:
            print(i - 1)
            break



import sys
ii = lambda: sys.stdin.readline().strip()
idata = lambda: [int(x) for x in ii().split()]

def solve():
    ans = 0
    cnt = 1
    s = 1
    n = int(ii())
    while s <= n:
        cnt = 2 * cnt + 1
        ans += 1
        n -= s
        s = (cnt * (cnt + 1)) // 2
    print(ans)
    return

for t in range(int(ii())):
    solve()