# coding: utf-8

loop do
  n, s = gets.chomp.split.map {|i| i.to_i} 
  break if n == 0 && s == 0

  array = Array.new
  (0..9).each do |j|
    array << j
  end
  cnt = 0
  array.combination(n) do |comb|
    sum = 0
    comb.each do |i|
      sum += i
    end
    cnt += 1 if sum == s
  end
  puts cnt
end