t=int(input())
while ( t > 0 ):
a,b,c,d=map(int,input().split())
if (d-c == c-b): print(a,b,c,d,b-a+d,"\n")
else:
print(a,b,c,d,d*b/a,"\n")
t=t-1