#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T t) {
  return t < 0 ? -t : t;
}
const long long modn = 1000000007;
inline long long mod(long long x) { return x % modn; }
const int MAXN = 2123;
int n, m, k;
int s[MAXN], w[MAXN], pai[MAXN], sz[MAXN];
long long dp[MAXN][2];
int cs[MAXN], cw[MAXN];
vector<int> hos[MAXN];
int raiz(int i) {
  if (pai[i] == i) return i;
  return pai[i] = raiz(pai[i]);
}
void join(int i, int j) {
  i = raiz(i);
  j = raiz(j);
  if (i == j) return;
  if (sz[i] < sz[j]) swap(i, j);
  sz[i] += sz[j];
  pai[j] = i;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int a = 1; a <= n; a++) {
    pai[a] = a;
    sz[a] = 1;
    scanf("%d", &w[a]);
  }
  for (int a = 1; a <= n; a++) {
    scanf("%d", &s[a]);
  }
  for (int a = 1; a <= m; a++) {
    int i, j;
    scanf("%d%d", &i, &j);
    join(i, j);
  }
  for (int a = 1; a <= n; a++) {
    hos[raiz(a)].push_back(a);
    cw[raiz(a)] += w[a];
    cs[raiz(a)] += s[a];
    ;
  }
  int inv = 0;
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  for (int a = 1; a <= n; a++) {
    if (hos[a].empty()) continue;
    for (int i = 0; i <= k; i++) {
      if (dp[i][inv] != -1) {
        dp[i][inv ^ 1] = max(dp[i][inv ^ 1], dp[i][inv]);
        if (i + cw[a] <= k) {
          dp[i + cw[a]][inv ^ 1] =
              max(dp[i + cw[a]][inv ^ 1], dp[i][inv] + cs[a]);
          ;
          ;
        }
        for (int h : hos[a]) {
          if (i + w[h] <= k)
            dp[i + w[h]][inv ^ 1] =
                max(dp[i + w[h]][inv ^ 1], dp[i][inv] + s[h]);
        }
      }
    }
    for (int i = 0; i <= k; i++) {
      dp[i][inv] = -1;
    }
    inv ^= 1;
  }
  long long res = 0;
  for (int a = 0; a <= k; a++) {
    res = max(res, dp[a][inv]);
    ;
  }
  printf("%lld\n", res);
}
