#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *args[]) {
  // get parameters from stdin
  float a, b, c;
  scanf("%f %f %f", &a, &b, &c);
  float d, e, f;
  scanf("%f %f %f", &d, &e, &f);
  
  // variables for answer
  float x, y;
  
  /** Explanation for solving problem
   * =============
   *  ax + by = c
   *  dx + ey = f
   * =============
   * 1. multiplying LCM or just CM for removing x (or y)
   * ===================
   *  d(ax + by) = d(c)
   *  a(dx + ey) = a(f)
   * ===================
   * 2. subtract with two equations
   * =========================
   *     adx + dby = cd
   *   - adx + aey = af
   *  -----------------------
   *    (db - ae)y = cd - af
   * =========================
   * 3. get y
   * ===============
   *       cd - af
   *  y = ---------
   *       db - ae
   * ===============
   * 4. get x
   * ==============
   *  ax + by = c
   * ==============
   *       c - by
   *  x = --------
   *         a
   * ==============
   * 5. solved
  */
  
  // error handling for dividing by zero
  if (d * b == a * e) {
    puts("-1");
    return 1;
  }
  y = (d * c - a * f) / (d * b - a * e);
  
  // error handling for dividing by zero
  if (a == 0) {
    puts("-1");
    return 1;
  }
  x = (c - b * y) / a;
  
  // print answer
  printf("%.01f\n", x);
  printf("%.01f\n", y);
  
  return 0;
}
