#include <iostream>
using namespace std;
int main() {
int a, b, c, d, t;
cin >> t;
while (t-->0) {
cin >> a >> b >> c >> d;
if (d - c == c - b ) cout << a <<" " << b<<" " << c<<" " << d <<" " << b - a + d<<"\n";
else cout << a<<" " << b<<" " << c<<" " << d<<" " << d * b<<"\n";
}
}