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