def f(n, s, min)
    if n == 1
        min <= s && s <= 9 ? 1 : 0
    else
        (min..9).map{|x| f(n-1, s-x, x+1)}.inject(0, :+)
    end
end

loop {
    n, s = gets.split.map(&:to_i)
    break if n == 0
    p f(n, s, 0)
}