import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  [n,_] <- map (read::String->Int) . words <$> getLine
  s <- map (read::String->Int) . words . unwords . lines <$> getContents
  (putStrLn . unlines . map (show .length) . elemIndicesList [1..n]) s

elemIndicesList [] list = []
elemIndicesList (x:xs) list  = elemIndices x list : elemIndicesList xs list