#include<iostream>
#include<cstdio>
#include<iomanip>

int gcd(int a,int b){
	if(a<b)b%=a;
	if(b==0)return a;
	int c=b;b=a%b;a=c;
	return gcd(a,b);
}

int lcm(int a,int b){
	int c=gcd(a,b);
	return c*(a/c)*(b/c);
}

int main(){
	int a,b,c,d,e,f;
	double x,y;
	std::cin>>a>>b>>c>>d>>e>>f;
	int g=lcm(a,d);
	y=(c*g/a-f*g/d)/(b*g/a-e*g/d);
	x=(c-y*b)/a;
	printf("%.3f %.3f\n",x,y);
	return 0;
}