def f(d): return 10 ** d if d >= 1 else 0 for _ in range(int(input())): d = int(input()) ans = f(d) - f(d-1) print(ans)