using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class Point {
        public int A { get; set; }
        public int B { get; set; }
        public int C { get; set; }
        public long Sum { get; set; }
    }

    class MainClass {

        public static void Main() {
            int x = NextInt, y = NextInt, z = NextInt, k = NextInt;
            var a = LongList.OrderByDescending(i => i).ToList();
            var b = LongList.OrderByDescending(i => i).ToList();
            var c = LongList.OrderByDescending(i => i).ToList();
            var stack = new List<Point>();
            var pq = new PriorityQueue<Point>((p1, p2) => p1.Sum < p2.Sum ? 1 : p1.Sum == p2.Sum ? 0 : -1);
            pq.Enqueue(new Point { A = 0, B = 0, C = 0, Sum = a[0] + b[0] + c[0] });

            for (int count = 0; count < k;) {
                var tmp = pq.Dequeue();

                if (stack.Any(p => p.A == tmp.A && p.B == tmp.B && p.C == tmp.C)) continue;

                if (tmp.A + 1 < x) pq.Enqueue(new Point { A = tmp.A + 1, B = tmp.B, C = tmp.C, Sum = a[tmp.A + 1] + b[tmp.B] + c[tmp.C] });
                if (tmp.B + 1 < y) pq.Enqueue(new Point { A = tmp.A, B = tmp.B + 1, C = tmp.C, Sum = a[tmp.A] + b[tmp.B + 1] + c[tmp.C] });
                if (tmp.C + 1 < z) pq.Enqueue(new Point { A = tmp.A, B = tmp.B, C = tmp.C + 1, Sum = a[tmp.A] + b[tmp.B] + c[tmp.C + 1] });

                stack.Add(tmp);

                count++;
                Console.WriteLine(tmp.Sum);
            }
        }
    }

    class MyMath {
        public const long mod = 1000000007;

        public static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }

        public static long Sqrt(long n) {
            if (n < 0) return 0;
            long a = 0, tmp = 0, b = 0;
            for (int i = 62; i >= 0; i -= 2) {
                tmp = (b << 1) + 1 <= (n >> i) ? 1 : 0;
                a = a << 1 | tmp;
                n -= (((b << 1) + 1) * tmp) << i;
                b = (b << 1) + tmp + tmp;
            }
            return a;
        }
    }

    public class PriorityQueue<T> {

        readonly List<T> _heap = new List<T>();
        readonly Comparison<T> _comparison;

        public PriorityQueue(Comparison<T> comparison) {
            _comparison = comparison;
        }

        public PriorityQueue() : this(Comparer<T>.Default.Compare) { }

        public PriorityQueue(IComparer<T> comparer) : this(comparer.Compare) { }

        public void Enqueue(T item) {
            _heap.Add(item);

            int childID = _heap.Count - 1;
            int parentID = (childID - 1) / 2;

            while (childID > 0 && _comparison(_heap[parentID], _heap[childID]) > 0) {
                Swap(parentID, childID);
                childID = parentID;
                parentID = (parentID - 1) / 2;
            }
        }

        public T Dequeue() {
            var first = _heap.First();
            _heap[0] = _heap.Last();
            _heap.RemoveAt(_heap.Count - 1);

            int parentID = 0;
            int childID = parentID * 2 + 2;
            if (childID >= _heap.Count || _comparison(_heap[childID], _heap[childID - 1]) > 0) childID--;

            while (childID < _heap.Count && _comparison(_heap[parentID], _heap[childID]) > 0) {
                Swap(parentID, childID);
                parentID = childID;
                childID = parentID * 2 + 2;
                if (childID >= _heap.Count || _comparison(_heap[childID], _heap[childID - 1]) > 0) childID--;
            }

            return first;
        }

        void Swap(int parent, int child) {
            var tmp = _heap[parent];
            _heap[parent] = _heap[child];
            _heap[child] = tmp;
        }

        public T Peek() { return _heap[0]; }
        public int Count => _heap.Count;
        public bool Any() { return _heap.Any(); }
        public List<T> Data => _heap;
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line => Console.ReadLine();

        public static string[] StrArr => Line.Split(' ');

        public static int NextInt => int.Parse(NextWord());

        public static long NextLong => long.Parse(NextWord());

        public static List<int> IntList => StrArr.Select(int.Parse).ToList();

        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        public static string NextWord() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr.AsEnumerable().GetEnumerator();
            }
            return enumerator.Current;
        }
    }
}

Measured memory_bytes: 16224