N=int(input()) for i in range(N): d=int(input()) for j in range(2,100000): if d%j!=0: print(j*d) break