while input=gets
	n,s=input.chomp.split(" ").map{|s| s.to_i}

	break if n==0 && s==0

	digs=(0..9).map{|k| k}
	count=0
	digs.combination(n) do |arr|
		if arr.inject{|a,b| a+b}==s then
			count+=1
		end
	end

	puts count
end
