x, y, z, k = list(map(int, input().split()))

a = list(map(int, input().split()))

b = list(map(int, input().split()))

c = list(map(int, input().split()))



xy = []

for aa in a:

    for bb in b:

        xy.append(aa + bb)

xy.sort(reverse=True)

t =[]

for d in xy[:k]:

    for cc in c:

        t.append(d+cc)

t.sort(reverse=True)

for tt in t[:k]:

    print(tt)
from heapq import *





x, y, z, k = list(map(int, input().split()))

a = sorted(list(map(int, input().split())), reverse=True)

b = sorted(list(map(int, input().split())), reverse=True)

c = sorted(list(map(int, input().split())), reverse=True)

a.append(-float('inf'))

b.append(-float('inf'))

c.append(-float('inf'))



done = {}

h = []

heappush(h, (-(a[0] + b[0] + c[0]), 0, 0, 0))

done[0,0,0] = 1

ind = 0

while ind < k:

    t = heappop(h)

    print((-t[0]))

    ind += 1

    if (t[1]+1, t[2], t[3]) not in done:

        done[t[1]+1, t[2], t[3]] = 1

        heappush(h, (-(a[t[1]+1] + b[t[2]] + c[t[3]]), t[1] + 1, t[2], t[3]))

    if (t[1], t[2]+1, t[3]) not in done:

        done[t[1], t[2]+1, t[3]] = 1

        heappush(h, (-(a[t[1]] + b[t[2]+1] + c[t[3]]), t[1], t[2]+1, t[3]))

    if (t[1], t[2], t[3]+1) not in done:

        done[t[1], t[2], t[3]+1] = 1

        heappush(h, (-(a[t[1]] + b[t[2]] + c[t[3]+1]), t[1], t[2], t[3]+1))

x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
xy = []
for aa in a:
    for bb in b:
        xy.append(aa + bb)
xy.sort(reverse=True)
t = []
for d in xy[:k]:
    for cc in c:
        t.append(d + cc)
t.sort(reverse=True)
for tt in t[:k]:
    print(tt)

from heapq import *

x, y, z, k = list(map(int, input().split()))
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)
a.append(-float("inf"))
b.append(-float("inf"))
c.append(-float("inf"))
done = {}
h = []
heappush(h, (-(a[0] + b[0] + c[0]), 0, 0, 0))
done[0, 0, 0] = 1
ind = 0
while ind < k:
    t = heappop(h)
    print((-t[0]))
    ind += 1
    if (t[1] + 1, t[2], t[3]) not in done:
        done[t[1] + 1, t[2], t[3]] = 1
        heappush(h, (-(a[t[1] + 1] + b[t[2]] + c[t[3]]), t[1] + 1, t[2], t[3]))
    if (t[1], t[2] + 1, t[3]) not in done:
        done[t[1], t[2] + 1, t[3]] = 1
        heappush(h, (-(a[t[1]] + b[t[2] + 1] + c[t[3]]), t[1], t[2] + 1, t[3]))
    if (t[1], t[2], t[3] + 1) not in done:
        done[t[1], t[2], t[3] + 1] = 1
        heappush(h, (-(a[t[1]] + b[t[2]] + c[t[3] + 1]), t[1], t[2], t[3] + 1))

+from heapq import * + -a = list(map(int, input().split())) -b = list(map(int, input().split())) -c = list(map(int, input().split())) -xy = [] -for aa in a: -    for bb in b: -        xy.append(aa + bb) -xy.sort(reverse=True) -t = [] -for d in xy[:k]: -    for cc in c: -        t.append(d + cc) -t.sort(reverse=True) -for tt in t[:k]: -    print(tt) +a = sorted(list(map(int, input().split())), reverse=True) +b = sorted(list(map(int, input().split())), reverse=True) +c = sorted(list(map(int, input().split())), reverse=True) +a.append(-float("inf")) +b.append(-float("inf")) +c.append(-float("inf")) +done = {} +h = [] +heappush(h, (-(a[0] + b[0] + c[0]), 0, 0, 0)) +done[0, 0, 0] = 1 +ind = 0 +while ind < k: +    t = heappop(h) +    print((-t[0])) +    ind += 1 +    if (t[1] + 1, t[2], t[3]) not in done: +        done[t[1] + 1, t[2], t[3]] = 1 +        heappush(h, (-(a[t[1] + 1] + b[t[2]] + c[t[3]]), t[1] + 1, t[2], t[3])) +    if (t[1], t[2] + 1, t[3]) not in done: +        done[t[1], t[2] + 1, t[3]] = 1 +        heappush(h, (-(a[t[1]] + b[t[2] + 1] + c[t[3]]), t[1], t[2] + 1, t[3])) +    if (t[1], t[2], t[3] + 1) not in done: +        done[t[1], t[2], t[3] + 1] = 1 +        heappush(h, (-(a[t[1]] + b[t[2]] + c[t[3] + 1]), t[1], t[2], t[3] + 1))