import Data.List

rearranging :: [Int] -> Int -> [Int]
rearranging [] n = [1..n]
rearranging (h:t) n = h : delete h (rearranging t n)

main = do
  l <- getContents
  let g = map read $ words l
  let n = head g
  let list = tail . tail $ g
  putStrLn . unlines . (map show) $ rearranging (reverse list) n