# 想定解法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()))



A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



AB = []

for a in A:

  for b in B:

    AB.append(a+b)



AB.sort(reverse=True)

AB = AB[:K]



ABC = []

for ab in AB:

  for c in C:

    ABC.append(ab+c)



ABC.sort(reverse=True)

ABC = ABC[:K]



for ans in ABC:

  print(ans)

# 想定解法2



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)



ids = []

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

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

    if x*y > K:

        break

    for z in range(1, Z+1):

      if x*y*z <= K:

        ids.append((x-1, y-1, z-1))

      else:

        break

      

Ans = []

for x, y, z in ids:

  Ans.append(A[x]+B[y]+C[z])



Ans.sort(reverse=True)

Ans = Ans[:K]

for ans in Ans:

  print(ans)
# 想定解法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()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB.sort(reverse=True)
AB = AB[:K]
ABC = []
for ab in AB:
    for c in C:
        ABC.append(ab + c)
ABC.sort(reverse=True)
ABC = ABC[:K]
for ans in ABC:
    print(ans)

# 想定解法2
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)
ids = []
for x in range(1, X + 1):
    for y in range(1, Y + 1):
        if x * y > K:
            break
        for z in range(1, Z + 1):
            if x * y * z <= K:
                ids.append((x - 1, y - 1, z - 1))
            else:
                break
Ans = []
for x, y, z in ids:
    Ans.append(A[x] + B[y] + C[z])
Ans.sort(reverse=True)
Ans = Ans[:K]
for ans in Ans:
    print(ans)

-# 想定解法1 +# 想定解法2 -AB = [] -for a in A: -    for b in B: -        AB.append(a + b) -AB.sort(reverse=True) -AB = AB[:K] -ABC = [] -for ab in AB: -    for c in C: -        ABC.append(ab + c) -ABC.sort(reverse=True) -ABC = ABC[:K] -for ans in ABC: +ids = [] +for x in range(1, X + 1): +    for y in range(1, Y + 1): +        if x * y > K: +            break +        for z in range(1, Z + 1): +            if x * y * z <= K: +                ids.append((x - 1, y - 1, z - 1)) +            else: +                break +Ans = [] +for x, y, z in ids: +    Ans.append(A[x] + B[y] + C[z]) +Ans.sort(reverse=True) +Ans = Ans[:K] +for ans in Ans: