"use strict";
const input = require("fs").readFileSync("/dev/stdin", "utf8").trim();

const inputs = input.split("\n");

const parse = (val) => val.split(" ").map(i => +i);

const sort = (arr) => arr.sort( (a, b) => b - a );

const transform = (arr) => sort(parse(arr));

const exec = (inputs) => {
  const firstLine = parse(inputs.shift());
  const X = firstLine[0];
  const Y = firstLine[1];
  const Z = firstLine[2];
  const K = firstLine[3];
  const As = transform(inputs[0]);
  const Bs = transform(inputs[1]);
  const Cs = transform(inputs[2]);

  const res = [];

  for (const A of As) {
    for (const B of Bs) {
      for (const C of Cs) {
        res.push(A + B + C);
      }
    }
  }

  return res.sort( (a, b) => b - a );
}

console.log(exec(inputs).join("\n"));