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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])

Buggy python submission (verdict: Time Limit Exceeded):
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 = sorted(a,reverse=True)
b = sorted(b,reverse=True)
c = sorted(c,reverse=True)

l = []
for i in range(x):
    for j in range(y):
            l.append(a[i] + b[j])
ll = []
for i in range(len(l)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])

Buggy python submission (verdict: Time Limit Exceeded):
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 = sorted(a,reverse=True)
b = sorted(b,reverse=True)
c = sorted(c,reverse=True)

l = []
for i in range(x):
    for j in range(y):
            l.append(a[i] + b[j])
ll = []
for i in range(len(l)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])

Buggy python submission (verdict: Time Limit Exceeded):
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 = sorted(a,reverse=True)
b = sorted(b,reverse=True)
c = sorted(c,reverse=True)

l = []
for i in range(min(1000,x)):
    for j in range(min(1000,y)):
            l.append(a[i] + b[j])
l = sorted(l,reverse=True)
ll = []
for i in range(len(l)):
    for j in range(min(1000,z)):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])

Buggy python submission (verdict: Time Limit Exceeded):
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 = sorted(a,reverse=True)
b = sorted(b,reverse=True)
c = sorted(c,reverse=True)

l = []
for i in range(min(200,x)):
    for j in range(min(200,y)):
        for t in range(min(200,z)):
            l.append(a[i] + b[j] + c[t])
l = sorted(l,reverse=True)
for i in range(k):
    print(l[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])

Buggy python submission (verdict: Time Limit Exceeded):
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 = sorted(a,reverse=True)
b = sorted(b,reverse=True)
c = sorted(c,reverse=True)

l = []
for i in range(min(500,x)):
    for j in range(min(500,y)):
        for t in range(min(500,z)):
            l.append(a[i] + b[j] + c[t])
l = sorted(l,reverse=True)
for i in range(k):
    print(l[i])


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

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

l = sorted(l,reverse=True)
ll = []
for i in range(min(len(l),k)):
    for j in range(z):
        ll.append(l[i] + c[j])

ll = sorted(ll,reverse=True)
for i in range(k):
    print(ll[i])