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]

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