while dataset = gets do

  if dataset.chomp! == ""
    break
  end

  dataArray = Array.new
  dataArray = dataset.split(" ")

  a = dataArray[0].to_f
  b = dataArray[1].to_f
  c = dataArray[2].to_f
  d = dataArray[3].to_f
  e = dataArray[4].to_f
  f = dataArray[5].to_f

  x = 1/(a*e-b*d)*(e*c-b*f)
  y = 1/(a*e-b*d)*(-d*c+a*f)

  printf("%.3f %.3f\r\n",x,y)
end