ary = []
formula3 = []
cc = 0

while ary = gets
  int_ary = ary.split(' ').map(&:to_f)
  formula1 = int_ary[0, 3]
  formula2 = int_ary[3, 3]

  if formula1[0] <= formula2[0]
    num = formula2[0]
    tmp = formula2[0]
    while (num % formula1[0]) != 0
      num += tmp
    end
    least_common_multiple = num
    v1 = least_common_multiple / formula1[0]
    v2 = least_common_multiple / formula2[0]
    formula3 = formula1.map{ |n| n * v1}
    formula4 = formula2.map{ |n| n * v2}
    cc = 0
  else
    num = formula1[0]
    tmp = formula1[0]
    while (num % formula2[0]) != 0
      num += tmp
    end
    least_common_multiple = num
    v1 = least_common_multiple / formula1[0]
    v2 = least_common_multiple / formula2[0]
    formula3 = formula1.map{ |n| n * v1}
    formula4 = formula2.map{ |n| n * v2}
    cc = 1
  end

  if cc == 0
    diff = formula4.zip(formula3).map{|i, j| i - j}
    y = diff[2] / diff[1]
    formula1[1] = formula1[1] * y
    an = formula1[2] - formula1[1]
    x = an / formula1[0]
  else
    diff = formula4.zip(formula3).map{|i, j| i - j}
    y = diff[2] / diff[1]
    formula1[1] = formula1[1] * y
    an = formula1[2] - formula1[1]
    x = an / formula1[0]
  end
  printf("%.3f %.3f\n", x, y)
end