for _ in range(int(input())): d = int(input()) print(10**d-10**(d-1))