#include<bits/stdc++.h>
using namespace std;
 main(){
  int a,b,c,d,e,f,r,lcm;
  int n,m;
  int x,y,num,sum;

  while(cin>>a>>b>>c>>d>>e>>f){

    if(a>d){
      m=a;
      n=d;
      if(a<0){
	m*=-1;
      }
      if(d<0){
	n*=-1;
      }
    }
    else{
      m=d;
      n=a;
      if(a<0){
	n*=-1;
      }
      if(d<0){
	m*=-1;
      }
    }

    r=m%n;
    while( r != 0 ){
      m=n;
      n=r;
      r=m%n;
    }
    lcm=a*d/n;

    num=lcm/a;
    sum=lcm/d;

    a*=num;
    b*=num;
    c*=num;

    d*=sum;
    e*=sum;
    f*=sum;

    if( a-d == 0 ){
      y=(c-f)/(b-e);
    }
    else if( a+b == 0 ){
      y=(c+f)/(b+e);
    }

    x=(c-b*y)/a;

    printf("%.3f %.3f\n",(double)x,(double)y);

  }
  return(0);
}