n = int(input())
import math
while n:
m = int(input())
r = []
for i in range(1,int(math.sqrt(m))+1):
if m % i ==0:
r.append(i)
j = int(m/i)
if j != i:
r.append(j)
r.sort()
print(' '.join(map(str,r)))
n -= 1