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