#include<iostream>
#include<iomanip>
using namespace std;

int main(){
	int i = 0;
	double a, b, c, d, e, f;
	double x[2], y[2];
	while (i<=1){
		cin >> a >> b >> c >> d >> e >> f;
		x[i] = (c*e - f*b) / (a*e - b*d);
		y[i] = (c - a*x[i])/b;
		i++;
	}
	for (int j = 0; j < 2; j++){
		cout << fixed << setprecision(3) << x[j]+0.0001 << " " << setprecision(3) << y[j] +0.0001<< '\n';
	}

	return 0;
}