# -*- coding: utf-8 -*-

import itertools

import sys

import math

from functools import lru_cache



# 1整数

# n = int(input())



# 空白区切り2変数

from queue import Queue

from operator import mul

from functools import reduce

from queue import Queue

from operator import mul

from functools import reduce

from functools import lru_cache



input = sys.stdin.readline



# N個整数

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



# 1整数

# n = int(input())



# 空白区切りリスト整数

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

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

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



ll = [0] * 1000001

count = 0

for i in a:

    for j in b:

        ll[count] = i + j

        count += 1

ll.sort(reverse=True)



ll = ll[0:3000]

c.sort(reverse=True)



lll = [0] * 3000001

count = 0

for i in ll:

    for j in c:

        lll[count] = i + j

        count += 1

lll.sort(reverse=True)



for i in range(k):

    print((lll[i]))



# 空白区切り文字列

# t, d = input().split()

# -*- coding: utf-8 -*-

import itertools

import sys

import math

from functools import lru_cache



# 1整数

# n = int(input())



# 空白区切り2変数

from queue import Queue

from operator import mul

from functools import reduce

from queue import Queue

from operator import mul

from functools import reduce

from functools import lru_cache



input = sys.stdin.readline



# N個整数

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



# 1整数

# n = int(input())



# 空白区切りリスト整数

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)





ll = []

count = 0

for i in range(len(a)):

    for j in range(len(b)):

        if i * j > kk:



            break

        for k in range(len(c)):

            if i * j * k > kk:

                break

            ll.append(a[i] + b[j] + c[k])

ll.sort(reverse=True)



for i in range(kk):

    print((ll[i]))



# 空白区切り文字列

# t, d = input().split()

# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())
# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline
# N個整数
x, y, z, k = list(map(int, input().split()))
# 1整数
# n = int(input())
# 空白区切りリスト整数
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ll = [0] * 1000001
count = 0
for i in a:
    for j in b:
        ll[count] = i + j
        count += 1
ll.sort(reverse=True)
ll = ll[0:3000]
c.sort(reverse=True)
lll = [0] * 3000001
count = 0
for i in ll:
    for j in c:
        lll[count] = i + j
        count += 1
lll.sort(reverse=True)
for i in range(k):
    print((lll[i]))
# 空白区切り文字列
# t, d = input().split()

# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())
# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline
# N個整数
x, y, z, kk = list(map(int, input().split()))
# 1整数
# n = int(input())
# 空白区切りリスト整数
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)
ll = []
count = 0
for i in range(len(a)):
    for j in range(len(b)):
        if i * j > kk:
            break
        for k in range(len(c)):
            if i * j * k > kk:
                break
            ll.append(a[i] + b[j] + c[k])
ll.sort(reverse=True)
for i in range(kk):
    print((ll[i]))
# 空白区切り文字列
# t, d = input().split()

-x, y, z, k = list(map(int, input().split())) +x, y, z, kk = list(map(int, input().split())) -ll = [0] * 1000001 +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) +ll = [] -for i in a: -    for j in b: -        ll[count] = i + j -        count += 1 +for i in range(len(a)): +    for j in range(len(b)): +        if i * j > kk: +            break +        for k in range(len(c)): +            if i * j * k > kk: +                break +            ll.append(a[i] + b[j] + c[k]) -ll = ll[0:3000] -c.sort(reverse=True) -lll = [0] * 3000001 -count = 0 -for i in ll: -    for j in c: -        lll[count] = i + j -        count += 1 -lll.sort(reverse=True) -for i in range(k): -    print((lll[i])) +for i in range(kk): +    print((ll[i]))