t=int(input()) for _ in range(t): n=int(input()) if n==0: print(0,0) else: bit=bin(n)[2:] x=2**(len(bit)-1) y=int(bin(n)[3:],2) print(x,y)