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

main = do
    n <- readLn :: IO Int
    a <- map read . words <$> getLine :: IO [Int]
    mapM_ (putStrLn . unwords . map show) $ scanl insSort' a [1..n-1]
  where
    insSort' :: Ord a => [a] -> Int -> [a]
    insSort' a i =
        let (l, r) = splitAt i a
            v = head r
            i' = fromMaybe (length l) $ findIndex (v<) l
            l' = insertAt i' v l
            r' = tail r
        in l' ++ r'

    insertAt :: Int -> a -> [a] -> [a]
    insertAt i v a = take i a ++ [v] ++ drop i a

