T = int(input()) for i in range(T): iN = int(input()) test = iN * 2 A = iN + test B = iN * (10 ** len(str(test))) + test while B % A != 0: test += A - B % A A = iN + test B = iN * (10 ** len(str(test))) + test print(test)