#include <iostream>
#include <math.h>
using namespace std;
int main() {
	int i;
	double a[2], b[2], c[2], x, y;
	cin >> a[0] >> b[0] >> c[0] >> a[1] >> b[1] >> c[1];
	if (a[0] == 0) {
		y = c[0] / b[0];
		x = (c[1] - b[1] * y) / a[1];
	}
	else if (b[0] == 0) {
		x = c[0] / a[0];
		y = (c[1] - a[1] * x) / b[1];
	}
	else if (a[1] == 0) {
		y = c[1] / b[1];
		x = (c[0] - b[0] * y) / a[0];
	}
	else if (b[1] == 0) {
		x = c[1] / a[1];
		y = (c[0] - a[0] * x) / b[0];
	}
	else {
		x = (c[1] - c[0] * b[1] / b[0]) / (a[1] - a[0] * b[1] / b[0]);
		y = (c[0] - a[0] * x) / b[0];
	}
	x = x * 1000;
	x = round(x);
	x = x / 1000;
	y = y * 1000;
	y = round(y);
	y = y / 1000;
	cout << x << endl << y << endl;
	return 0;
}