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()))



ab = []



for s in a:

    for t in b:

       ab.append(s + t)



ab.sort(reverse=True)

c.sort(reverse=True)



ans = []



for i in range(min(k, len(ab))):

    for u in c:

        ans.append(ab[i] + u)



ans.sort(reverse=True)



for i in range(k):

    print((ans[i]))

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()))



ans = []



a.sort(reverse=True)

b.sort(reverse=True)

c.sort(reverse=True)



for s in range(x):

    for t in range(y):

        for u in range(z):

            if (s+1) * (t+1) * (u+1) > k:

                break

            ans.append(a[s] + b[t] + c[u])



ans.sort(reverse=True)



for i in range(k):

    print((ans[i]))
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()))
ab = []
for s in a:
    for t in b:
        ab.append(s + t)
ab.sort(reverse=True)
c.sort(reverse=True)
ans = []
for i in range(min(k, len(ab))):
    for u in c:
        ans.append(ab[i] + u)
ans.sort(reverse=True)
for i in range(k):
    print((ans[i]))

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()))
ans = []
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
for s in range(x):
    for t in range(y):
        for u in range(z):
            if (s + 1) * (t + 1) * (u + 1) > k:
                break
            ans.append(a[s] + b[t] + c[u])
ans.sort(reverse=True)
for i in range(k):
    print((ans[i]))

-ab = [] -for s in a: -    for t in b: -        ab.append(s + t) -ab.sort(reverse=True) +ans = [] +a.sort(reverse=True) +b.sort(reverse=True) -ans = [] -for i in range(min(k, len(ab))): -    for u in c: -        ans.append(ab[i] + u) +for s in range(x): +    for t in range(y): +        for u in range(z): +            if (s + 1) * (t + 1) * (u + 1) > k: +                break +            ans.append(a[s] + b[t] + c[u])