#include <iostream> 
using namespace std;
const int n = 1000, m = 1000, j = 1000, h = 1000, k = 1000, l = 1000, q = 1000, w = 1000;
double a[n], b[m], c[j], d[h], e[k], f[l];
double x[q], y[w]; 
int main () {
	for (int i = 1; i<= 2; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i] >> f[i];
	}

	for (int i = 1; i<= 2; i++) {
		x[i] = (c[i] * e[i] - b[i] * f[i]) / (a[i] * e[i] - b[i] * d[i]);
		y[i] = (a[i] * f[i] - c[i] * d[i]) / (a[i] * e[i] - b[i] * d[i]);
		printf ("%.3f %.3f", x[i], y[i]);
		cout << endl;
	}
	
	return 0;
}