#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
int T;
scanf("%d", &T);
while (T-- != 0) {
double a, b, c, d;
scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
double r = sqrt(d / c);
double x = r * a - b;
double y = r * b - a;
printf("%.10lf %.10lf\n", x, y);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpIHsKCWludCBUOwoJc2NhbmYoIiVkIiwgJlQpOwoJd2hpbGUgKFQtLSAhPSAwKSB7CgkJZG91YmxlIGEsIGIsIGMsIGQ7CgkJc2NhbmYoIiVsZiVsZiVsZiVsZiIsICZhLCAmYiwgJmMsICZkKTsKCQlkb3VibGUgciA9IHNxcnQoZCAvIGMpOwoJCWRvdWJsZSB4ID0gciAqIGEgLSBiOwoJCWRvdWJsZSB5ID0gciAqIGIgLSBhOwoJCXByaW50ZigiJS4xMGxmICUuMTBsZlxuIiwgeCwgeSk7Cgl9CglyZXR1cm4gMDsKfQo=