import Control.Monad
main = do
    str <- getLine
    if str == "0 0" then return ()
                    else do
                        let [len,sumNum] = map read.words $ str
                        print $ length.filter(\x -> sum x == sumNum && length x == len).filterM (\x -> [True,False]) $ [0..9] 
                        main