program main
  implicit none
  integer(8) :: X,Y,Z,K
  integer:: tot
  integer(8),allocatable :: A(:),B(:),C(:)
  integer(8),allocatable :: ABC(:)
  integer(8),allocatable :: ABC2(:)
  integer :: i1,i2,i3,i
  read(*,*) X,Y,Z,K
  allocate(A(X),B(Y),C(Z))
  read(*,*) A(:)
  read(*,*) B(:)
  read(*,*) C(:)

  allocate( ABC(X*Y*Z) )
  tot=X*Y*Z
  i = 0
  do i1 = 1,X
     do i2 = 1,Y
        do i3 = 1,Z
           i = i + 1
           ABC(i) = A(i1) + B(i2) + C(i3)
        end do
     end do
  end do
  ABC2 = iqsort(ABC)
  do i = 1,K
     write(*,'(i0)') ABC2(tot-i+1)
  end do
  stop
contains
  recursive function iqsort(ix) result(ires)
    integer(8), allocatable :: ires(:)
    integer(8), intent(in)  :: ix(:)
    integer(8) :: k
    if (size(ix) <= 1) then 
       ires = ix
    else  
       k = ix(size(ix) / 2)
       ires = [iqsort(pack(ix, ix < k)), pack(ix, ix == k), iqsort(pack(ix, ix > k))] 
    end if
  end function iqsort
end program main