import sys # 求最大公约数 def gcd(a, b): if b == 0: return a else: return(gcd(b, a%b)) while 1: try: n, level = map(int, input().strip().split()) for i in range(n): x, y, z = map(int, input().strip().split()) maxnum = gcd(gcd(x, y), 2*level-z) print(f"{x//maxnum} {y//maxnum} {(2*level-z)//maxnum}&quo...