#coding:utf-8




def solve(i,s,n)
	if s == $sum && n == 0 then
			$count += 1
			return
	end

	if i==10 || n==0 then
		return
	end
	#print "i:#{i}, s:#{s}, n:#{n}\n"
	solve(i+1, s+i, n-1)
	solve(i+1, s, n)
	
end

while true do
	str = gets.chomp.split(' ').map(&:to_i)
	break if str == [0,0]
	n,$sum = str[0], str[1]
	$count = 0
	
	#puts n
	#puts $sum

	solve(0,0,n)
	puts $count

end