#include <iostream>
using namespace std;
int main() {
int m[5],t=0,b=0;
cin>>b;
if(20>=t>=0)
{
while(b>t)
{
cin>>m[0]>>m[1]>>m[2]>>m[3];
m[4]=0;
if( (m[1]/m[0]) == (m[2]/m[1]) == (m[3]/m[2]) )
{
m[4]=m[3]+(m[3]-m[2]);
cout << m[0] <<" "<< m[1] <<" "<< m[2] <<" "<< m[3]<<" "<<m[4]<<endl;
}
if((m[1]/m[0]==m[2]/m[1]) && (m[2]/m[1]==m[3]/m[2]))
{
m[4]=m[3]*(m[3]/m[2]);
cout << m[0] <<" "<< m[1] <<" "<< m[2] <<" "<< m[3]<<" "<<m[4]<<endl;
}
t=t+1;
}
}
}