import Control.Monad

main :: IO ()
main = do
  n <- readLn
  if n == 0
    then return ()
    else do
      ls <- replicateM n readLn
      let ans = solve ls
      mapM_ putStrLn ans
      main

solve :: [Int] -> [String]
solve ls = map show (count ls)
  where
    count :: [Int] -> [Int]
    count ls = count' ls [0,0,0,0,0,0,0]
      where
        count' :: [Int] -> [Int] -> [Int]
        count' [] counter = counter
        count' (x:xs) counter = count' xs counter'
          where
            counter' = (plus1 (min (x `div` 10) 6) counter)
            plus1 :: Int -> [Int] -> [Int]
            plus1 n (x:xs)
              | n <= 0 = (x+1):xs
              | otherwise = x:(plus1 (n-1) xs)