T = int(input()) for _ in range(T): N = int(input()) A = N // 9 B = ((N-1) % 9) + 1 print(B*10**17 - A,B*10**17)