#define _GLIBCXX_DEBUG #include using namespace std; typedef long long ll; #define rep(i,a,b) for(int i=a;i; // intの1次元の型に vi という別名をつける using vvi = vector; // intの2次元の型に vvi という別名をつける using si =vector; using ssi =vector; //using mint = modint998244353; const long long INF = 1e18; ll MIN(ll a,ll b){ if(a>b)return b; else return a; } int main() { ll N,M,W; cin>>N>>M>>W; vectorA(N),B(M),C(M); rep(i,0,N)cin>>A[i]; rep(i,0,M)cin>>B[i]; rep(i,0,M)cin>>C[i]; vectorSUM(N+1); sort(A.begin(),A.end(),greater()); rep(i,0,N)SUM[i+1]+=SUM[i]+A[i]; ll ans=0; for(ll bit=0;bit<(1<W)continue; ans=max(ans,pr+SUM[MIN(W-sum,N)]); } cout<