#include <iostream>
using namespace std;
int main() {
int a, b, c, t, d ;
cin>>d ;
while(d-->0) {
cin>>a>>b>>c>>t;
if(b-a==t-c) cout << a<<" "<< b<<" "<< c<<" "<< t<<" "<< b-a+t ;
else cout <<a<<" "<<b<<" "<<c<<" "<<t<<" "<<t*d ;
}
}
錯在那裡會一職重複很多遍加return 0又CE@@