T = int(input()) for _ in range(T): N = int(input()) if(N.bit_count() == 1): print(-1) continue one = [] for i in range(1000): if(1<