PROGRAM ATCODER

implicit none
integer(16) :: x,y,z,k,i,j,index=0,n
integer(16),allocatable :: a(:),b(:),c(:),d(:)

read*, x,y,z,k
allocate(a(x),b(y),c(z),d(106307))
a = 0 ; b = 0 ; c = 0 ; d = 0
read*, a(1:x),b(1:y),c(1:z)

call hs(x,a) ; call hs(y,b) ; call hs(z,c)

do i = 0, x-1, 1
  do j = 0, y-1, 1
    do n = 0, z-1, 1
      if ( i*j*n > k ) then
        cycle
      else
        index = index + 1
        d(index) = a(x-i) + b(y-j) + c(z-n)
      end if
    end do
  end do
end do

call hs(int(106307,16),d)

do i = 0, k-1
  print'(i0)', d(106307-i)
end do

contains
  subroutine hs(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.ne.1)
     if(l.gt.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 hs

END PROGRAM ATCODER