t=int(input())
for i in range(t):
t1,t2,t3,t4=map(int,input().split())
if t2-t1==t4-t3:
print (t1,t2,t3,t4,t4+(t4-t3))
else:
print (t1,t2,t3,t4,t4*(t4//t3))