Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()
ab.reverse()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[i] + c[j])

abc.sort()
abc.reverse()

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


Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

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

a.sort()
a.reverse()
b.sort()
b.reverse()
c.sort()
c.reverse()

cnum = []

takadaka = math.ceil(k ** 0.7)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

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


Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

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

a.sort()
a.reverse()
b.sort()
b.reverse()
c.sort()
c.reverse()

cnum = []

takadaka = math.ceil(k ** 0.67)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

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


Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

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

a.sort()
b.sort()
c.sort()

cnum = []

takadaka = math.ceil(k ** 0.75)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

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


Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

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

a.sort()
b.sort()
c.sort()

cnum = []

takadaka = math.ceil(k)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

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

Fixed submission:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])