input_a = gets.to_s
input_b = gets.to_s

formula_a = input_a.split(' ').map(&:to_i)
formula_b = input_b.split(' ').map(&:to_i)

fa_x = ((formula_a[2] * formula_a[4]) - (formula_a[1] * formula_a[5])) / ((formula_a[0] * formula_a[4]) - (formula_a[1] * formula_a[3]))
fa_y = ((formula_a[0] * formula_a[5]) - (formula_a[2] * formula_a[3])) / ((formula_a[0] * formula_a[4]) - (formula_a[1] * formula_a[3]))
fb_x = ((formula_b[2] * formula_b[4]) - (formula_b[1] * formula_b[5])) / ((formula_b[0] * formula_b[4]) - (formula_b[1] * formula_b[3]))
fb_y = ((formula_b[0] * formula_b[5]) - (formula_b[2] * formula_b[3])) / ((formula_b[0] * formula_b[4]) - (formula_b[1] * formula_b[3]))

puts format('%.3f', fa_x) + " " + format('%.3f', fa_y)
puts format('%.3f', fb_x) + " " + format('%.3f', fb_y)