b = "0123456789" for _ in range(int(input())): N = int(input()) q, r = divmod(N, 10) S = b * q + b[:r] print(S)