package practice;
import java.util.*;
public class B1 {
public static main(String[] args) {
int t;
Scanner sc=new Scanner(System.in);
t=sc.nextInt();
while(t!=0) {
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int d=sc.nextInt();
if(d-c==c-b&&c-b==b-a) {
System.out.println(a+" "+b+" "+c+" "+d+" "+(d+d-c));
}
if(d/c==c/b&&c/b==b/a) {
System.out.println(a+" "+b+" "+c+" "+d+" "+(d*d/c));
}
t--;
}
}
}