T = int(input())for _ in range(T): N = int(input()) a,b = 1, 17 a = a* 10**N r = str(a//b).zfill(N+1) print(r[-1], sum(map(int, r[1:])))