T=int(input()) for i in range(T): N=int(input()) N=(2*N)-1 ans=1 s=0 while True: ans*=2 s+=1 if (ans-1)%N==0: print(s) break