#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
  double a,b,c,d,e,f,x,y;
  while(cin >> a){
    cin >> b >> c >> d >> e >> f;
    if(b == 0){
      x = c / a;
    }else if(e == 0){
      x = f / d;
    }else if(b != 0 && e != 0){
      double g = a / b;
      double h = d / e;
      double i = c / b;
      double j = f / e;
      x = (i - j) / (g - h);
    }else{
      return -1;
    }
    if(b != 0){
      y = (c - a * x) / b;
    }else{
      y = (f - d * x) / e;
    }
    x = (int)(x * 1000) / (double)(1000);
    y = (int)(y * 1000) / (double)(1000);
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}