#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"I=lambda:map(int,input().split());*_,k=I();s=lambda*a:sorted(i+j for i in I()for j in a)[:~k:-1];print(*s(*s(*I())))\n"
"\"";
  system(s);
  return 0;
}