#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,t;//宣告
cin>>t;
for(t>=0;t<=3;t++)//迴圈輸入
{
while(cin>>a>>b>>c>>d){
e=d+c-b;
if(b-a==c-b)
{
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<endl;
}
else if(e=d*c/b)
{
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<endl;
}
}}
return 0;
}