#include <stdio.h>

main() {
  double a,b,c,d,e,f;
  double x,y;
  while(scanf("%lf %lf %lf",&a,&b,&c)!=EOF) {
    scanf("%lf %lf %lf",&d,&e,&f);
    x=y=-1;
    if(a==0||d==0) {
      if(a==0)
	x=0;
      if(b==0)
	y=0;
    }
    if(a!=0)
      y = (d*c/a - f) / (d*b/a - e);
    if(d!=0)
      x = f/d - e/d*y;
    printf("%.3lf %.3lf\n",x,y);
  }
}