for i in range(int(input())):int_numbers = list(map(int, input().split()))print(' '.join(str(x) for x in int_numbers) + ' ' + str((int_numbers[3] * (int_numbers[1]//int_numbers[0])) if (int_numbers[1]/int_numbers[0] == int_numbers[2]/int_numbers[1]) else (int_numbers[3] + (int_numbers[1]-int_numbers[0]))))
一行
for _ in range(int(input())):print(*((lambda a:(a[0],a[1],a[2],a[3],a[3]+a[1]-a[0]) if a[1]-a[0]==a[2]-a[1] else (a[0],a[1],a[2],a[3],a[3]*a[1]//a[0]))(list(map(int,input().split())))))