import Control.Monad
import Data.Array
import qualified Data.ByteString.Char8 as C
import Data.List

main = sol <$> get >>= mapM_ print

get = fmap (unfoldr (C.readInt . C.dropWhile (==' '))) . C.lines <$> C.getContents 

sol ([n,_]:es) = elems . accumArray (+) 0 (1,n) $ zip (concat es) (repeat 1)