import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char
import Data.Ord
import Data.Array.IO

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

f n s = length . filter ((==s) . sum) . filter ((==n) . length) $ subsequences [0..9]

main = do
    [n, s] <- getInts
    when (n/=0 || s/=0) $ do
        print $ f n s
        main