T = int(input()) while T: N = int(input()) X = 0 for i in range(60): if N>>i&1: X = 1<