import qualified Data.Set as Set
import Data.List

g::Int->Int->Int->Int->Int->Int->[Int]->[Int]->[Int]->Set.Set (Int,Int,Int,Int,Int)->[Int]
g k 1 c2 x1 y1 z1 xs ys zs ss
          |x1-1>=0=let t=((xs!!(x1-1))+(ys!!y1)+zs!!(z1),1,x1-1,y1,z1)
                   in g k 2 c2 x1 y1 z1 xs ys zs (Set.insert t ss)
          |otherwise=g k 2 c2 x1 y1 z1 xs ys zs ss
g k 2 c2 x1 y1 z1 xs ys zs ss
          |y1-1>=0&&2<=c2=let t=((xs!!(x1))+(ys!!(y1-1))+zs!!z1,2,x1,y1-1,z1)
                          in g k 3 c2 x1 y1 z1 xs ys zs (Set.insert t ss)
          |otherwise=g k 3 c2 x1 y1 z1 xs ys zs ss
g k 3 c2 x1 y1 z1 xs ys zs ss
          |z1-1>=0&&3<=c2=let t=((xs!!(x1))+(ys!!(y1))+zs!!(z1-1),3,x1,y1,z1-1)
                          in f k xs ys zs (Set.insert t ss)
          |otherwise=f k xs ys zs ss


f::Int->[Int]->[Int]->[Int]->Set.Set (Int,Int,Int,Int,Int)->[Int]
f 1 _ _ _ ss=let (n,_,_,_,_)=Set.findMax ss
             in [n]
f k xs ys zs ss=let (n,c2,x1,y1,z1)=Set.findMax ss
                in n:(g (k-1) 1 c2 x1 y1 z1 xs ys zs (Set.deleteMax ss))
       

main = do
       ls<-getLine
       xs<-getLine
       ys<-getLine
       zs<-getLine
       let (x:y:z:k:[])=map read (words ls)::[Int]
           xs2=sort $ map read (words xs)::[Int]
           ys2=sort $ map read (words ys)::[Int]
           zs2=sort $ map read (words zs)::[Int]
           ts=(xs2!!(x-1)+ys2!!(y-1)+zs2!!(z-1),3,x-1,y-1,z-1)
       mapM_ putStrLn $ map show $ f k xs2 ys2 zs2 (Set.fromList [ts])