import heapq as hq

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

a.sort(reverse=True)

b.sort(reverse=True)

c.sort(reverse=True)

ans = []

for p in range(1,x+1):

  for q in range(1,y+1):

    for r in range(min(k//(p*q)+1,z)):

      ans.append(-(a[p-1]+b[q-1]+c[r]))

hq.heapify(ans)

for i in range(k):

  s = hq.heappop(ans)

  print((-s))
import sys

import heapq as hq

input = sys.stdin.readline

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

a.sort(reverse=True)

b.sort(reverse=True)

c.sort(reverse=True)

ans = []

for p in range(1,x+1):

  for q in range(1,y+1):

    for r in range(min(k//(p*q)+1,z)):

      ans.append(-(a[p-1]+b[q-1]+c[r]))

hq.heapify(ans)

for i in range(k):

  s = hq.heappop(ans)

  print((-s))
import heapq as hq

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()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans = []
for p in range(1, x + 1):
    for q in range(1, y + 1):
        for r in range(min(k // (p * q) + 1, z)):
            ans.append(-(a[p - 1] + b[q - 1] + c[r]))
hq.heapify(ans)
for i in range(k):
    s = hq.heappop(ans)
    print((-s))

import sys
import heapq as hq

input = sys.stdin.readline
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()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans = []
for p in range(1, x + 1):
    for q in range(1, y + 1):
        for r in range(min(k // (p * q) + 1, z)):
            ans.append(-(a[p - 1] + b[q - 1] + c[r]))
hq.heapify(ans)
for i in range(k):
    s = hq.heappop(ans)
    print((-s))

+import sys +input = sys.stdin.readline