#include<stdio.h>

int main(){
	
	double a,b,c,A,B,C,x,y;
	
	while(scanf("%lf",&a)!=EOF){
		
		scanf("%lf %lf %lf %lf %lf",&b,&c,&A,&B,&C);
		
		y=(c*A-C*a)/(b*A-B*a);
		x=(c*B-C*b)/(a*B-A*b);
		
		printf("%.3lf %.3lf\n",x,y);
		
	}
	
	return 0;
}