require "matrix"

$<.map {|a| a.split.map(&:to_i)}.each do |a|
  Matrix[[a[0], a[1]], [a[3], a[4]]]
    .lup
    .solve([a[2], a[5]])
    .map{|b| b.to_f.round(3)}
    .tap{|c| print format("%.3f %.3f\n", c[0], c[1])}
end
