import Data.List
main = do
  _ <- getLine
  a  <- map read . words <$> getLine :: IO[Integer]
  b <- map read . words <$> getLine :: IO[Integer]
  c <- map read . words <$> getLine :: IO[Integer]
  let s = map show (reverse (sort [p+q+r | p <- a, q <- b, r <- c]))
  putStrLn $ unlines $ if length s <= 3000 then s else take 3000 s
