integer(16) X,Y,Z,K,t
integer(16),allocatable,dimension(:)::xi,yi,zi
integer(16),allocatable,dimension(:)::xy,xyk
integer(16),allocatable,dimension(:)::xyz
read*,X,Y,Z,K
allocate(xi(x),yi(y),zi(z))
read*,xi
read*,yi
read*,zi
allocate(xy(x*y))
allocate(xyk(k))
do i=1,x
  do j=1,y
    xy(x*(j-1)+i)=xi(i)+yi(j)
  end do
end do

call heapsort(x*y,xy)

if(x*y>K)then
  do i=1,K
    xyk(i)=xy(x*y-i+1)
  end do
  t=k*z
  allocate(xyz(t))
  do i=1,K
    do j=1,z
      xyz((j-1)*k+i)=xyk(i)+zi(j)
    end do
  end do
  
  call heapsort(k*z,xyz)
  do i=1,k
    print"(i0)",xyz(k*z-i+1)
  end do
else
  t=x*y*z
  allocate(xyz(t))
  do i=1,x*y
    do j=1,z
      xyz((j-1)*x*y+i)=xy(i)+zi(j)
    end do
  end do
  
  call heapsort(x*y*z,xyz)
  
  do i=1,k
  print"(i0)",xyz(x*y*z-i+1)
  end do
endif

contains

subroutine heapsort(n,array)
  implicit none
  integer(16),intent(in) :: n
  integer(16),intent(inout) :: array(1:n)
  
  integer(16)::i,k,j,l
  integer(16):: t

  if(n.eq.1)return

  l=n/2+1
  k=n
  do while(k /= 1)
     if(l > 1)then
        l=l-1
        t=array(L)
     else
        t=array(k)
        array(k)=array(1)
        k=k-1
        if(k.eq.1) then
           array(1)=t
           exit
        endif
     endif
     i=l
     j=l+l
     do while(j.le.k)
        if(j.lt.k)then
           if(array(j).lt.array(j+1))j=j+1
        endif
        if (t.lt.array(j))then
           array(i)=array(j)
           i=j
           j=j+j
        else
           j=k+1
        endif
     enddo
     array(i)=t
  enddo
  return
end subroutine heapsort
end