module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector            as V
import           Text.Printf

main :: IO ()
main = do
  [x,y,z,k] <- map read . words <$> getLine
  [as,bs,cs] <- replicateM 3 $ V.fromList . take k . sortBy (flip compare) . map read . words <$> getLine :: IO [V.Vector Integer]
  mapM_ print =<< take k <$> f as bs cs (minimum [k, x, y, z])

f as bs cs m = do
  flags <- newArray ((0,0,0),(m - 1,m - 1,m - 1)) False :: IO (IOUArray (Int, Int, Int) Bool)
  sortBy (flip compare) . concat <$> mapM (\x -> g flags as bs cs [(i, j, k) | i <- [0 .. x], j <- [0 .. x], k <- [0 .. x]]) [0 .. (m - 1)]

g :: IOUArray (Int, Int, Int) Bool -> V.Vector Integer -> V.Vector Integer -> V.Vector Integer -> [(Int, Int, Int)] -> IO [Integer]
g _  _  _  _  [] = return []
g fl as bs cs ((i,j,k):is) = do
  bl <- readArray fl (i,j,k)
  if bl
    then g fl as bs cs is
    else do
      writeArray fl (i,j,k) True
      nexts <- g fl as bs cs is
      return (((as V.! i) + (bs V.! j) + (cs V.! k)):nexts)
