#include using namespace std; void read(vector &v, int sz) { for(int i = 0; i < sz; i++) { cin >> v[i]; } } long long get_floor(long long lo, long long hi) { long long x = (lo + hi); if(abs(x) % 2 == 0) return x / 2; if(x > 0) return x / 2; return (x - 1) / 2; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int K, L, M, N; long long S; cin >> K >> L >> M >> N >> S; vector A(K), B(L), C(M), D(N); read(A, K); read(B, L); read(C, M); read(D, N); vector fl, fr; for(int i = 0; i < K; i++) for(int j = 0; j < L; j++) fl.push_back(A[i] * B[j]); sort(fl.begin(), fl.end()); for(int i = 0; i < M; i++) for(int j = 0; j < N; j++) fr.push_back(C[i] * D[j]); sort(fr.begin(), fr.end()); vector pos, neg; int zer = 0; for(int i = 0; i < K; i++) for(int j = 0; j < L; j++) { if(A[i] * B[j] > 0) pos.push_back(A[i] * B[j]); else if(A[i] * B[j] < 0) neg.push_back(A[i] * B[j]); else ++zer; } sort(pos.begin(), pos.end()); sort(neg.begin(), neg.end()); long long T; long long lo = -1e18, hi = 1e18; for(int x = 0; x < 62; x++) { long long mid = get_floor(lo, hi); long long num = 0LL; int j = (int) fr.size() - 1; for(int i = 0; i < (int) pos.size(); i++) { while(j >= 0 && pos[i] * 1LL * fr[j] > mid) --j; num += j + 1; } j = 0; for(int i = (int) neg.size() - 1; i >= 0; i--) { while(j < M * N && neg[i] * 1LL * fr[j] > mid) ++j; num += M * N - j; } if(mid >= 0) num += zer * 1LL * M * N; if(num < S) lo = mid + 1; else hi = mid; } T = lo; long long left = 0LL, right = 0LL; for(int i = 0; i < K * L; i++) if(T % fl[i] == 0) left = fl[i], right = T / fl[i]; pair x, y; for(int i = 0; i < K; i++) { for(int j = 0; j < L; j++) { if(A[i] * 1LL * B[j] == left) x = {A[i], B[j]}; } } for(int i = 0; i < M; i++) { for(int j = 0; j < N; j++) { if(C[i] * 1LL * D[j] == right) y = {C[i], D[j]}; } } cout << T << "\n"; cout << x.first << " " << x.second << " " << y.first << " " << y.second << "\n"; }