def dfs(a, n, s)
  return (a.inject(:+) == s) ? 1 : 0 if a.size == n

  ans = 0
  (a.empty? ? 0 : a.max + 1).upto(9) do |i|
    ans += dfs(a + [i], n, s)
  end
  ans
end

while true
  n, s = gets.split(' ').map(&:to_i)
  break if n == 0 && s == 0
  puts dfs([], n, s)
end