import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = readContents 4 >>= printRes . solve
    where
        printRes = mapM_ print

solve :: [[Int]] -> [Int]
solve [[_, _, _, k], as, bs, cs] = take k $ sortBy (flip compare) [a + bc | a <- as, bc <- bcs]
    where
        bcs = take k $ sortBy (flip compare) [b + c | b <- bs, c <- cs]


readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine