S = "1234567890" for _ in range(int(input())): N = int(input()) if N <= 9: print("0" + S[: N - 1]) else: print(S[: N % 10] + S * (N // 10))