while line = gets
  n,s = line.split.map(&:to_i)
  break if n == 0 && s == 0
  counter = 0
  combi = (0..9).to_a.combination(n)
  combi.each {|arr|  counter += 1 if (arr.inject {|mem, sum|  sum += mem} == s) }
  p counter
end