#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

#define add push_back
#define inf 2147000000

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	double a,b,c,d,e,f,g,h,i,x,y;
	
	while(scanf("%lf",&a)!=EOF){
		scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&f);
		
		
		g=a/d;
		d*=g;
		e*=g;
		f*=g;
		
		h=b-e;
		i=c-f;
		
		x=i/h;
		h=a;
		i=c-b*x;
		y=i/h;
		
		printf("%.3lf %.3lf\n",y,x);
	}
}