import math Q = int(input()) for _ in range(Q): P = float(input().strip()) e_single = round(P ** 2) sqrt_e = math.sqrt(e_single) if abs(sqrt_e - P) <= 1e-10: print(f"1 {e_single}") else: e1 = 10000000 e2 = 15000000 e3 = 20000000 print(f"3 {e1} {e2} {e3}")