#include <stdio.h>

int main() {
	float a, b, c, d, e, f;
	float x, y;

	while (scanf("%f", &a) != EOF) {
		scanf("%f %f %f %f %f", &b, &c, &d, &e, &f);
		b *= d / a;
		c *= d / a;
		a = d;
		if ((a > 0 && d > 0) || (a < 0 && d < 0)) {
			a *= -1;
			b *= -1;
			c *= -1;
		}
		e += b;
		f += c;
		y = f / e;
		x = (-1 * b * y + c) / a;
		if (x == -0) x = 0;
		else if (y == -0) y = 0;

		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}