T = int(input()) for i in range(T): tmp = int(input()) x = tmp while True: tmp2 = int(str(tmp)+str(x)) tmp3 = tmp+x if tmp2%tmp3 == 0: print(x) break else: x+=tmp