while line = gets do
  a, b, c, d, e, f = line.chomp.split.map(&:to_f)
  case
  when d * e != 0
    g = b / e
    h = a / d
    x = c - g * f
    x = ( x == 0.0 )? x : x / ( a - g * d )
    y = c - h * f
    y = ( y == 0.0 )? y : y / ( b - h * e )
  when a * b != 0
    g = e / b
    h = d / a
    x = f - g * c
    x = ( x == 0.0 )? x : x / ( d - g * a )
    y = f - h * c
    y = ( y == 0.0 )? y : y / ( e - h * b )
  when a == 0
    x = f / d
    y = c / b
  when b == 0
    x = c / a
    y = f / e
  end
  puts sprintf( "%1.3f %1.3f", x, y )
end