## https://yukicoder.me/problems/no/3301 def solve(L): L0 = L pow2 = 1 while L % 2 == 0: pow2 *= 2 L //= 2 if L != 1: x = (L ** 2 + 1) // 2 y = (L ** 2 - 1) // 2 x *= pow2 y *= pow2 ans = [x, L0, y] else: pow2 //= 4 x = 3 * pow2 y = 5 * pow2 ans = [x, L0, y] return " ".join(map(str, ans)) def main(): T = int(input()) answers = [] for _ in range(T): L = int(input()) ans = solve(L) answers.append(ans) for ans in answers: print(ans) if __name__ == "__main__": main()