'use strict'
function main(input) {
  input = input.trim().split('\n')
  const counts = input.shift().split(' ')
  input = input.map(val => val.split(' '))

  const sum = (a, b, c) => Number(input[0][a]) + Number(input[1][b]) + Number(input[2][c])
  let result = []

  for (let i = 0; i < counts[0]; i++) {
    for (let j = 0; j < counts[1]; j++) {
      for (let k = 0; k < counts[2]; k++) {
        result.push(sum(i, j, k))
      }
    }
  }

  result = result.sort((a, b) => b - a).slice(0, counts[3])

  console.log(result.join('\n'))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
