#include<iostream>
using namespace std;
main()
{
int t, a[4];
for(cin >> t; t--; cout << endl)
{
for(auto &z:a)
cin >> z;
for(auto z:a)
cout << z << ' ';
if(a[3]-a[2] == a[2]-a[1])
cout << 2*a[3]-a[2];
else
cout << a[3]/a[2]*a[3];
}
}