import Control.Applicative
import Data.List
import Control.Monad


main = do
    n <- read <$> getLine :: IO Int
    xs <- map read.words <$> getLine :: IO [Int]
    mapM_ putStrLn $ map (f xs) [1..n]
    
qsort []     = []
qsort (p:xs) = qsort lt ++ [p] ++ qsort gteq
                 where
                   lt   = [x | x <- xs, x > p]
                   gteq = [x | x <- xs, x <= p]

f xs i = show.g $ sort xs' where
    xs' = qsort $ (take (i-1) xs) ++ (drop i xs)
    l = length xs - 1
    g  ys = ys !! ((div (l+1) 2)-1)
