while true
    d, e = gets.chomp.split.map(&:to_i)
    break if [d, e] == [0, 0]
    min = nil
    for north in 0..d
        east = d - north
        cost = Math.sqrt(north * north + east * east)
        zure = (cost - e).abs
        min = zure if min.nil? || min > zure
    end
    puts min
end
