import sys from decimal import Decimal, getcontext getcontext().prec = 50 # High precision to handle up to 15 decimal places accurately def solve(): Q = int(sys.stdin.readline()) for _ in range(Q): p_str = sys.stdin.readline().strip() p = Decimal(p_str) # Check if a single element works e_single = (p ** 2).quantize(Decimal('1'), rounding='ROUND_HALF_UP') error = abs(e_single.sqrt() - p) if error <= Decimal('1e-10'): print(f"1 {e_single}") else: # Use three elements as in the fourth sample print("3 10000000 15000000 20000000") if __name__ == "__main__": solve()