--{-# LANGUAGE OverloadedStrings #-}
--{-# LANGUAGE OverloadedLists   #-}
{-# LANGUAGE BangPatterns      #-} --引数に!
{-# LANGUAGE MultiWayIf        #-}
{-# LANGUAGE TupleSections     #-}

import Data.Bits
import Data.Foldable (foldlM,foldrM)
import Data.Maybe (fromJust)
import Data.List
--import Data.Matrix.Unboxed
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
import Data.Graph
--import Data.Vector as V　--変数衝突
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.Vector.Unboxed as V
import Control.Monad
import Control.Monad.State
import Control.Monad.ST
import Debug.Trace

type T = UArray Int Int

solve :: Int -> Int -> Int -> Int -> [Int] -> [Int] -> [Int] -> [Int]
solve x y z k as' bs' cs' = do
  let as = (sortOn (0-) as')
      bs = (sortOn (0-) bs')
      cs = (sortOn (0-) cs')
      sub l1 l2 = sortOn (0-) [x+y | x <- l1, y <- l2]
    in take k $ sub cs $ take k $ sub as bs


readBInt :: B.ByteString -> Int
readBInt = fst . fromJust . B.readInt

main0 :: B.ByteString -> [Int]
main0 cont =
   let remLines0 = map (map readBInt . B.words) (B.lines cont)
       [x,y,z,k]:remLines1 = remLines0
       as:remLines2 = remLines1
       bs:remLines3 = remLines2
       cs:remLines4 = remLines3
   in solve x y z k as bs cs

main :: IO ()
main = (flip forM_ $ \i -> print i) . main0 =<< B.getContents

mod' :: Int -> Int
mod' n = if n < 1000000007 then n else mod n 1000000007
