def solve n,s,a
  if n == 1 then
    if s>=a and s<=9 then
      return 1
    else
      return 0
    end
  end
  result = 0
  (a..s).each do |i| 
    result += solve(n-1, s-i, i+1)
  end

  return result
end

while line = STDIN.gets
  if line == "0 0\n" then break end
  n, s = line.chomp.split(' ').map { |item| item.to_i }
  puts solve(n,s,0)
end