BIG = 2 * 10 ** 17 def solve(): N = int(input()) if N <= 9: print(N, N) else: l = BIG - (N & 1) if N & 1: N -= 9 print(l, BIG + N // 2 - 1) for _ in range(int(input())): solve()