import Data.List import Data.Maybe appearance = [20104,20063,19892,20011,19874,20199,19898,20163,19956,19841] main = getLine >>= putStrLn . unwords . map show . count count ds = map fromJust $ sequence [findIndex (<0), findIndex (>0)] diff where diff = zipWith (-) appearance $ map (length . flip filter ds . (==)) ['0'..'9']