import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines """ 手元計算で使用したもの import numpy as np def find_approx_1(target, U=200, items=1): x = np.sqrt(np.arange(U, dtype=np.float64)) value = x for _ in range(items-1): value = np.add.outer(value, x) value %= 1 n = np.argmin(np.abs(value - target)) n = np.unravel_index(n, value.shape) return n, sum(x**.5 for x in n) def find_approx_2(target, U=200, items=2): x = np.sqrt(np.arange(U, dtype=np.float64)) value = x for _ in range(items-1): value = np.add.outer(value, x) value %= 1 shape = value.shape value = value.ravel() I = value.argsort() value1 = value[I] x = value1 y = (value1 - target) % 1 i = np.maximum(0, np.searchsorted(x, 1 - y) - 1) add = x[i] + y m = np.argmin(np.abs(1 - add)) n = i[m] m, n = I[m], I[n] x = value[m] + value[n] m = np.unravel_index(m, shape) n = np.unravel_index(n, shape) n = n + m x = sum(x ** .5 for x in n) return n, x """ use = [None] * 11 use[0] = (1,) use[1] = (26,) use[2] = (59, 152) use[3] = (29,58) use[4] = (201, 283) use[5] = (457, 763) use[6] = (79, 478, 495) use[7] = (385, 444, 454) use[8] = (200, 77, 130, 59) use[9] = (454, 21, 212, 308) use[10] = (83, 71, 131, 123, 59, 68) vals = [sum(x**.5 for x in nums) for nums in use] def solve(x): A = [] for nums, val in zip(use[1:], vals[1:]): coef = int((x % 1) // (val % 1)) x -= coef * val for n in nums: A.append(coef * coef * n) A.append(int(x) ** 2) return A Q = int(readline()) for x in map(float, read().split()): A = solve(x) print(30, *A)