n = int(input())
for item in range(n):
a1,a2,a3,a4 = map(int,input().split())
lst = [a1,a2,a3,a4]
for order in range(len(lst)-2):
if (lst[order + 2]-lst[order + 1]) == (lst[1]-lst[0]):
a5 = a4 + (a2-a1)
lst.append(a5)
lst2 = list(set(lst))
else:
if (lst[order + 2]/(lst[order + 1])) == (lst[1]/lst[0]):
a5 = int(a4 * (a2/a1))
lst.append(a5)
lst2 = list(set(lst))
else:
lst2 = ""
pass
try:
print(lst2[0],lst2[1],lst2[2],lst2[3],lst2[4])
except:
break
#更改後簡易解
n = int(input())
for item in range(n):
a1,a2,a3,a4 = map(int,input().split())
lst = [a1,a2,a3,a4]
if lst[3] - lst[2] == lst[2] - lst[1] and lst[2]-lst[1] == lst[1]-lst[0]:
a5 = a4 + (a2-a1)
lst.append(a5)
lst2 = (lst)
else:
if lst[3]/lst[2] == lst[2]/lst[1] and lst[2]/lst[1] == lst[1]/lst[0]:
a5 = int(a4 * (a2/a1))
lst.append(a5)
lst2 = list(lst)
else:
lst2 = ""
pass
try:
print(lst2[0],lst2[1],lst2[2],lst2[3],lst2[4])
except:
pass