use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        x: usize,
        y: usize,
        z: usize,
        k: usize,
        a: [usize;x],
        b: [usize;y],
        c: [usize;z]
    }

    let mut a = a;
    let mut b = b;
    let mut c = c;
    a.sort_by(|a, b| b.cmp(a));
    b.sort_by(|a, b| b.cmp(a));
    c.sort_by(|a, b| b.cmp(a));

    let mut pr_que: BinaryHeap<(usize, usize, usize, usize)> = BinaryHeap::new();
    let mut hashSet: HashSet<(usize, usize, usize)> = HashSet::new();

    let mut a_i = 0;
    let mut b_i = 0;
    let mut c_i = 0;

    pr_que.push((a[0] + b[0] + c[0], 0, 0, 0));
    hashSet.insert((0, 0, 0));
    for i in 0..k {
        let yum = pr_que.pop().unwrap();
        println!("{}", yum.0);

        if yum.1 + 1 < x && hashSet.get(&(yum.1 + 1, yum.2, yum.3)) == None {
            pr_que.push((a[yum.1 + 1] + b[yum.2] + c[yum.3], yum.1 + 1, yum.2, yum.3));
            hashSet.insert((yum.1 + 1, yum.2, yum.3));
        }

        if yum.2 + 1 < y && hashSet.get(&(yum.1, yum.2 + 1, yum.3)) == None {
            pr_que.push((a[yum.1] + b[yum.2 + 1] + c[yum.3], yum.1, yum.2 + 1, yum.3));
            hashSet.insert((yum.1, yum.2 + 1, yum.3));
        }

        if yum.3 + 1 < z && hashSet.get(&(yum.1, yum.2, yum.3 + 1)) == None {
            pr_que.push((a[yum.1] + b[yum.2] + c[yum.3 + 1], yum.1, yum.2, yum.3 + 1));
            hashSet.insert((yum.1, yum.2, yum.3 + 1));
        }
    }
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 8572