#include using namespace std; const int INF = 1<<30; const int MOD = 998244353; //const long long INF = 1LL<<60; using graph = vector>; using ll = long long; int main(){ ll n, m, w; cin >> n >> m >> w; vector a(n), b(m), c(m); for (int i=0; i < n; i++) cin >> a[i]; for (int i=0; i < m; i++) cin >> b[i]; for (int i=0; i < m; i++) cin >> c[i]; sort(a.begin(), a.end(), greater()); vector acc_a(n+1); for (int i=1; i < n+1; i++) acc_a[i] = acc_a[i-1] + a[i-1]; ll ans = 0LL; for (int i=0; i < (1< w){ flag = false; break; } } if (flag){ ll rem = w - weight; ans = max(ans, value + acc_a[min(n, rem)]); } } cout << ans << endl; }