import qualified Data.Map as M
import Control.Monad
import Control.Applicative

part _ n | n <= 0 = [0]
part [] _ = []
part (x:xs) n =  part xs n ++ (map (x+) $ part xs (n-1))

main = do
  [n, s] <- getInts
  if (n == 0 && s == 0) then return ()
  else do
    print $ length $ filter (== s) $ part [0..9] n
    main

getInts :: IO [Int]
getInts = map read . words <$> getLine