import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 N=I() for _ in range(N): d=I() res=9*pow(10,d-1) print(res)