#include<iostream>


using namespace std;

int main(){
	long a,b,c,d,e,f;
	long double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){

		x=(e*c-f*b)/(e*a-b*d);
		y=(d*c-f*a)/(b*d-a*e);
		x*=1000;
		x+=0.5;
		x=(long)x;
		x/=1000;

		y*=1000;
		y+=0.5;
		y=(long)y;
		y/=1000;

		cout<<x<<" "<<y<<endl;

		x=y=a=b=c=d=e=f=0;
	}
}