N = int(input()) for I in range(N): D = int(input()) if D == 1: print(10) else: print(10**D - 10**(D - 1))