while true
    line = gets
    break if not line
    
    n = line.chomp.split(" ").map &:to_f
    a,b,c = n[0],n[1],n[2]
    d,e,f = n[3],n[4],n[5]
    
    #delete x
    if a != 0 and d != 0
        b,c = b*n[3],c*n[3]
        e,f = e*n[0],f*n[0]
        y = (c-f)/(b-e)
    elsif a == 0
        y = c/b
    elsif d == 0
        y = e/f
    end
    
    #Reset
    a,b,c = n[0],n[1],n[2]
    d,e,f = n[3],n[4],n[5]
    
    #delete y
    if a != 0
        x = (c-b*y)/a
    else
        x = (f-e*y)/d
    end
    puts "#{x} #{y}"
end