#include <iostream>
#include <cmath>
using namespace std;

int main() {
  double a[2][2];
  double a_inv[2][2];
  double det;
  double b[2];
  double x[2];
  int tmp;
  while (1) {
    cin >> a[0][0] >> a[0][1] >> b[0];
    cin >> a[1][0] >> a[1][1] >> b[1];
    if (cin.eof()) break;

    det = a[0][0]*a[1][1] - a[0][1]*a[1][0];
    a_inv[0][0] = a[1][1]/det;
    a_inv[0][1] = -a[0][1]/det;
    a_inv[1][0] = -a[1][0]/det;
    a_inv[1][1] = a[0][0]/det;
    for (int i=0; i<2; i++) {
      x[i] = 0.0;
      for (int j=0; j<2; j++) {
        x[i] += a_inv[i][j]*b[j];
      }
      tmp = round(x[i]*1000);
      if (!tmp) x[i] = 0.0;
    }
    cout.setf(ios::fixed);
    cout.precision(3);
    cout << x[0] << " " << x[1] << endl;
  }
  return 0;
}