#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int man(int x, int y);
	double b=0, c=0, e, f, y, z, k, l;
	int x;
	double a, d;
	while (cin >> a >> b >> c >> d >> e >> f&&a != 0 && b != 0 && c != 0 && d != 0 && e != 0 && f != 0)
	{
		a = int(a);
		d = int(d);
		double s = b, v = c;
		x = man(a, d);
		a = double(a);
		d = double(d);
		x = double(x);
		y = x / a;
		z = x / d;
		b = b*y;
		c = c*y;
		e = e*z;
		f *= z;
		k = (c - f) / (b - e);
		l = (v - s*k) / a;
		cout << setiosflags(ios::fixed) << setprecision(4);
		cout << l << ' ' << k << endl;
	}
	return 0;
	
}
int man(int x, int y)
{
	int a, b, c;
	a = x*y;
	while (y != 0)
	{
		b = x%y;
		x = y;
		y = b;

	}
	b = a / x;
	return b;
}