import Data.Array

main = do
  let f i = (i+3)*(i+2)*(i+1) `div` 6 - max (2*(i-9)*(i-8)*(i-7) `div` 3) 0 in
    let p = array (0,50) $ zip [0..50] $ [ f i | i <- [0..18]++[17,16..0]] ++ [0,0..] in
      let g x = show $ p!(read x::Int) in
        putStr . unlines . map g . lines =<< getContents