while line = gets
    a,b,c,d,e,f = line.split(" ").map(&:to_i)
    det = a*e-b*d
    if det != 0 
        x = (e*c-b*f).quo(det).to_f
        y = (-c*d+a*f).quo(det).to_f
        puts sprintf("%.3f,%.3f",x , y)
    end
end