import Data.List

cmp [] [] = True
cmp (a:as) (b:bs) = if a /= b then False else cmp as bs

ans' :: Int -> [Int] -> Int -> [Int]
ans' n c k =
  if n < k * 2
  then []
  else
    let a = sort $ take k c
        b = sort $ drop (n-k) c
        x = ans' n c (k+1)
    in
      if cmp a b
      then k:x
      else x

ans n c k = 
  let t  = ans' n c k
      t' = reverse $ map (\a -> n - a) t
      t''= if (t'!!0) == (n `div` 2)
           then drop 1 t'
           else t'
  in
    if t == []
    then [n]
    else t ++ t'' ++ [n]

main = do
  n <- getLine
  c <- getLine
  let n' = read n :: Int
      c' = map read $ words c :: [Int]
      o  = ans n' c' 1
  putStrLn $ unwords $ map show o

