#include<stdio.h>
int main() {
    double a, b, c, d, e, f;
    double x, y, z;
    int i;
    for (i = 0; i < 2; i++) {
        scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
        z = d / a;
        b *= z;
        c *= z;
        y = (c - f) / (b - e);
        x = (f - e*y) / d;
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}