#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()); ll ans = 0LL; for (int i=0; i < (1< w){ flag = false; break; } } if (flag){ ll rem = w - weight; for (int i=0; i < min(rem, n); i++){ value += a[i]; } ans = max(ans, value); } } cout << ans << endl; }