module Main where import Control.Monad f :: Int -> [Int] -> Int -> [Int] f k xs y | y > k = y : xs | otherwise = xs main :: IO () main = do n <- readLn (k:as) <- replicateM n readLn :: IO [Int] let ss = scanl (f k) [] as let rs = fmap ((+ 1) . length) ss mapM_ print rs