def h(A,B,x): G=set(B) b=B[0] for a in A: if a==0: if x==0: return (0,b) elif (x%a==0) and (x//a in G): return (a,x//a) return None #Greedy解法 K,L,M,N,P=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) D=list(map(int,input().split())) E=[a*b*c*d for a in A for b in B for c in C for d in D] E.sort() J=E[P-1] U=[a*b for a in A for b in B] V=[c*d for c in C for d in D] p,q=h(U,V,J) a,b=h(A,B,p) c,d=h(C,D,q) print(J) print(a,b,c,d)