M = 10 ** 18 - 1 t = int(input()) for _ in range(t): n = int(input()) print(M - n)