while gets

values = gets
a,b,c,d,e,f = values.split(' ').map{|i| i.to_f}
if a == 0
 y = (c/b)
 x = ((f-e*y)/d)
elsif b == 0
 x = (c/a)
 y = ((f-d*x)/e)
elsif d == 0
 y = (f/e)
 x = ((c-b*y)/a)
elsif e == 0
 x = (f/d)
 y = ((c-a*x)/b)
else
 x = ((b*f-c*e)/(b*d-a*e))
 y = ((c-a*x)/b)
end
 
if x == 0
  x = x.to_s.delete("-").to_f
end

if y == 0
  y = y.to_s.delete("-").to_f
end

puts "#{sprintf("%.3f",x.round(3))} #{sprintf("%.3f",y.round(3))}"
end