import math
if __name__ == "__main__":
t = int(input())
for i in range(t):
n = int(input())
print(int(math.log(n,2))+1) # 二分法,每次都选中间的
2.https://www.nowcoder.com/question/next?pid=23354036&qid=967825&tid=33813424
def getmin(n):
if n%4==0 or n%4==3:
return 0
else:
return 1
def getmax(n):
return n-getmin(n-1)
if __name__ == "__main__":
t = int(input())
for i in range(t):
n = int(input())
print(getmin(n),getmax(n))