import Data.List (sort, unfoldr)
import qualified Data.Set as S
import Data.Array

main :: IO ()
main = do
  (x : y : z : k : _) <- map read . words <$> getLine :: IO [Int]
  as <- listArray (1, x) . reverse . sort . map read . words <$> getLine :: IO (Array Int Integer)
  bs <- listArray (1, y) . reverse . sort . map read . words <$> getLine :: IO (Array Int Integer)
  cs <- listArray (1, z) . reverse . sort . map read . words <$> getLine :: IO (Array Int Integer)
  let
    ds = unfoldr next (insert ((1, 1, 1), as ! 1 + bs ! 1 + cs ! 1) Nothing, S.singleton (1, 1, 1))
    next (Just h, s) = let (((i, j, k), d), h') = viewMax h in Just (d, insert' h' [(succ i, j, k), (i, succ j, k), (i, j, succ k)])
      where
        insert' h = foldr step (h, s)
        step ijk@(i, j, k) hs@(h, s) = if S.member ijk s then hs else (insert (ijk, as ! i + bs ! j + cs ! k) h, S.insert ijk s)
  mapM_ print . take k $ ds

data PH a = PH a [PH a]

merge :: Ord a => PH a -> PH a -> PH a
merge u@(PH x us) v@(PH y vs) = if y < x then PH x (v : us) else PH y (u : vs)

insert :: Ord a => a -> Maybe (PH a) -> Maybe (PH a)
insert = (Just .) . (maybe <$> id <*> merge) . flip PH []

viewMax :: PH a -> (a, Maybe (PH a))
viewMax = fmap (foldl ((Just .) . maybe id merge) Nothing . (maybe id (:) <$> fst <*> snd) . foldl step (Nothing, [])) . ph2tuple
  where
    ph2tuple (PH x us) = (x, us)
    step (Nothing, us) v = (Just v, us)
    step (Just u, us) v = (Nothing, merge u v : us)
