pows = [10] for _ in range(110): last = pows[-1] pows.append(last * 10) pows[0] += 1 n = int(input()) for _ in range(n): d = int(input()) if d == 1: print(pows[0]) else: print(pows[d - 1] - pows[d - 2])