l = (0..9).map{|i| i}
while gets
  n,s = $_.split.map(&:to_i)
  an = 0
  break if n == 0
  if s.between?(n, ([0,(9-n)].max..9).inject(:+))
    l.combination(n){|c|
      an += 1 if s == c.inject(:+)
    }
  end
  puts an
end