#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

double x(double a, double b, double c, double d, double e, double f);
double y(double a, double b, double c, double d, double e, double f);

double round3(double dat){

	int fct;
	fct = (int)pow(10, 3);
	dat *= fct;
	dat = round(dat);
	dat /= fct;
	return dat;
}

int main()
{
	double x1, x2, y1, y2, a, b, c, d, e, f;

	cin >> a >> b >> c >> d >> e >> f;

	x1 = x(a, b, c, d, e, f);
	y1 = y(a, b, c, d, e, f);

	cin >> a >> b >> c >> d >> e >> f;

	x2 = x(a, b, c, d, e, f);
	y2 = y(a, b, c, d, e, f);




	cout << fixed << setprecision(3) << round3(x1) << " " << round3(y1) << endl;
	cout << fixed << setprecision(3) << round3(x2) << " " << round3(y2) << endl;

	return 0;
}

double x(double a, double b, double c, double d, double e, double f) {

	return (c*e - b*f) / (a*e - b*d);
}

double y(double a , double b, double c, double d, double e, double f) {

	return (a*f - c*d) / (a*e - b*d);
}