for _ in range(int(input())): n = int(input()) print(9 * 10 ** (n - 1) + int(n == 1))