x,y,z,k=list(map(int,input().split()));a,b,c=list(map(int,input().split())),list(map(int,input().split())),list(map(int,input().split()))

aa=[]

for i in a:

  for j in b:aa.append(i+j)

aa.sort(reverse=1)

aa=aa[:k+1]

s=[]

for i in aa:

  for j in c:s.append(i+j)

s.sort(reverse=1)

for i in range(k):print((s[i]))
from heapq import heappop,heappush;import sys;input=sys.stdin.readline

x,y,z,k=list(map(int,input().split()));a,b,c=list(map(int,input().split())),list(map(int,input().split())),list(map(int,input().split()))

q,h,l=[],[],0

for i in a:

  for j in b:heappush(q,-(i+j));l+=1

for _ in range(min(l,k)):

  t=heappop(q)

  for i in c:heappush(h,t-i)

for i in range(k):print((-heappop(h)))
x, y, z, k = list(map(int, input().split()))
a, b, c = (
    list(map(int, input().split())),
    list(map(int, input().split())),
    list(map(int, input().split())),
)
aa = []
for i in a:
    for j in b:
        aa.append(i + j)
aa.sort(reverse=1)
aa = aa[: k + 1]
s = []
for i in aa:
    for j in c:
        s.append(i + j)
s.sort(reverse=1)
for i in range(k):
    print((s[i]))

from heapq import heappop, heappush
import sys

input = sys.stdin.readline
x, y, z, k = list(map(int, input().split()))
a, b, c = (
    list(map(int, input().split())),
    list(map(int, input().split())),
    list(map(int, input().split())),
)
q, h, l = [], [], 0
for i in a:
    for j in b:
        heappush(q, -(i + j))
        l += 1
for _ in range(min(l, k)):
    t = heappop(q)
    for i in c:
        heappush(h, t - i)
for i in range(k):
    print((-heappop(h)))

+from heapq import heappop, heappush +import sys + +input = sys.stdin.readline -aa = [] +q, h, l = [], [], 0 -        aa.append(i + j) -aa.sort(reverse=1) -aa = aa[: k + 1] -s = [] -for i in aa: -    for j in c: -        s.append(i + j) -s.sort(reverse=1) +        heappush(q, -(i + j)) +        l += 1 +for _ in range(min(l, k)): +    t = heappop(q) +    for i in c: +        heappush(h, t - i) -    print((s[i])) +    print((-heappop(h)))