input_a = gets
input_b = gets

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

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]))

fa_x.round(3)
fa_y.round(3)
fb_x.round(3)
fb_y.round(3)

puts sprintf('%.3f %.3f', fa_x, fa_y)
puts sprintf('%.3f %.3f', fb_x, fb_y)