import Control.Monad
import Data.List

getLineRepeat :: Int -> IO [String]
getLineRepeat times = replicateM times getLine

main = do
    first <- getLine
    d <- getLineRepeat 3
    let k = read $ (words first) !! 3 :: Int
    let rev = flip compare
    let cakeA = map read $ words (d !! 0) :: [Integer]
    let cakeB = map read $ words (d !! 1) :: [Integer]
    let cakeC = map read $ words (d !! 2) :: [Integer]
    let sum1 = take k $ sortBy rev [a + b | a <- cakeA, b <- cakeB]
    let sum = take k $ sortBy rev [ab + c | ab <- sum1, c <- cakeC]
    forM_ sum $ putStrLn . show 
