#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 s1 = (2 * c) / (a * b);
d *= 2;
d /= s1;
double x = sqrt((4 * a * d) / b) / 2 - b;
double y = (b * b + b * x - a * a) / a;
printf("%.10lf %.10lf\n", x, y);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKCmludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewoJaW50IFQ7CglzY2FuZigiJWQiLCAmVCk7Cgl3aGlsZSAoVC0tICE9IDApIHsKCQlkb3VibGUgYSwgYiwgYywgZDsKCQlzY2FuZigiJWxmJWxmJWxmJWxmIiwgJmEsICZiLCAmYywgJmQpOwoJCWRvdWJsZSBzMSA9ICgyICogYykgLyAoYSAqIGIpOwoJCWQgKj0gMjsKCQlkIC89IHMxOwoJCWRvdWJsZSB4ID0gc3FydCgoNCAqIGEgKiBkKSAvIGIpIC8gMiAtIGI7CgkJZG91YmxlIHkgPSAoYiAqIGIgKyBiICogeCAtIGEgKiBhKSAvIGE7CgkJcHJpbnRmKCIlLjEwbGYgJS4xMGxmXG4iLCB4LCB5KTsKCX0KCXJldHVybiAwOwp9Cg==