import Data.List

main = do
 n <- readLn
 as <- map read . words <$> getLine
 print (n3 n as)

n3 n as = max (sum as1' - sum as2') (sum bs1' - sum bs2')
 where
  (as1,as2) = splitAt (div (3*n+1) 2) as
  (as1',as2') = (drop (n-n') (sort as1), drop n' (reverse (sort as2)))
  (bs1,bs2) = splitAt (div (3*n) 2) as
  (bs1',bs2') = (drop n' (sort bs1), drop (n-n') (reverse (sort bs2)))
  n' = div n 2