Buggy python submission (verdict: Time Limit Exceeded):
# -*- 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 = [0] * 10000000
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[count] = a[i] + b[j] + c[k]
            count += 1
ll.sort(reverse=True)

for i in range(kk):
    print(ll[i])

# 空白区切り文字列
# t, d = input().split()


Fixed submission:
# -*- 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()

Buggy python submission (verdict: Runtime Error):
# -*- 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 = [0] * 1000000
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[count] = a[i] + b[j] + c[k]
            count += 1
ll.sort(reverse=True)

for i in range(kk):
    print(ll[i])

# 空白区切り文字列
# t, d = input().split()


Fixed submission:
# -*- 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()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- 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
import bisect

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

a.sort(reverse=True)
b.sort(reverse=True)
ll = []
for i in a:
    for j in b:

        if len(ll) > 3001 and ll[0] > i + j:
            break
        else:
            bisect.insort(ll, i + j)

ll = ll[0:3000]
c.sort(reverse=True)

lll = [0] * 3000001
for i in ll:
    for j in c:

        if len(lll) > 3001 and lll[0] > i + j:
            break
        else:
            bisect.insort(lll, i + j)

lll.reverse()

for i in range(k):
    print(lll[i])

# 空白区切り文字列
# t, d = input().split()


Fixed submission:
# -*- 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()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- 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()


Fixed submission:
# -*- 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()