import java.util.Scanner;
public class Test005 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int t,a,b,c,d;
t =input.nextInt();
while(0 <= t && t<= 20)
{
a = input.nextInt();
b = input.nextInt();
c = input.nextInt();
d = input.nextInt();
System.out.print(a+ " "+b+" "+c+" "+d+" ");
if(b-a==c-d)
{
System.out.println(d-c+d);
}
else
{
System.out.println(d/c*d);
}
}
}
}