#include<stdio.h>
int a,b, c, d, e, f;

int main()
{
while(scanf("%d",&a)!=EOF)
	{
		double x,y;
		scanf("%d %d %d %d %d",&b,&c,&d,&e,&f);
		x=(e*c-b*f)/(e*a-b*d);
		y=(c-a*x)/b;
		printf("%0.3f %0.3f\n",x,y);
	}
}