#include<iostream>
int GCM(int a,int b){
	if(b==0)return a;
	return GCM(b,a%b);
}

int main(){
	int a,b,c,d,e,f;
	while(std::cin>>a>>b>>c>>d>>e>>f){
		float x,y;
		int a_=a,b_=b,c_=c,d_=d,e_=e,f_=f;
		b_*=GCM(a,d)/a,c_*=GCM(a,d)/a;
		e_*=GCM(a,d)/d,f_*=GCM(a,d)/d;
		y=(c_-f_)/(b_-e_);
		x=(c-y*b)/a;
		std::cout<<x<<" "<<y<<std::endl;
	}
	return 0;
}