def h(A,B,x): G=set(B) for a in A: if x%a==0 and x//a in B: 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)