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