t = int(input())for i in range(1,t+1): a = [int(x) for x in input().split()] if a[0]+a[3]==a[1]+a[2]:a.append(a[3]*2-a[2]) else:a.append(a[3]*a[3]//a[2]) print(*a)