def solve(m,i,c)
#       puts "%d:%d:%d"%[m,i,c]
        return 0 if m>i
        return 0 if m==9
        return 1 if c==1
        res = 0
        (m..i).each do |x|
                break if solve(x+1, i-x, c-1)==0
                res += 1
        end
        return res
end

while true
        n,s = gets.split.map{|x|x.to_i}
        exit if n==0

        puts solve(-1,s,n)
end