#include <iostream>
int main() {
int a, b, c, d, e, i, k;
std::cin >> k;
for (i = 0; i < k; i++) {
std::cin >> a >> b >> c >> d;
if (b - a == d - c) {
std::cout <<a<<" "<<b<<" "<<c<<" "<<d<<" "<< d + d - c <<"\n";
}
else {
std::cout << a<<" "<< b<<" " << c<<" " << d<<" " << d*d / c;
}
}
return 0 ;
}
#include
int main() {
int a, b, c, d, e, i, k;
std::cin >> k;
for (i = 0; i < k; i++) {
std::cin >> a >> b >> c >> d;
if (b - a == d - c) {
std::cout <<a<<" "<<b<<" "<<c<<" "<<d<<" "<< d + d - c <<"\n";
}
else {
std::cout << a<<" "<< b<<" " << c<<" " << d<<" " << d*d / c;
}
}
return 0 ;
}
輸出等比數列那段記得換行