N = int(input()) for i in range(N): d = int(input()) if d == 1: print(10) else: print(int("9" * d) - int("9" * (d - 1)))