N=int(input()) for i in range(N): d=int(input()) ans=9*(10**(d-1)) if d==1: ans+=1 print(ans)