#include <bits/stdc++.h>
using namespace std;
const int N = int(3e5), mod = int(1e9) + 7;
int n, m, second;
int a[N];
pair<int, int> b[N];
pair<int, pair<int, int> > p[N];
int pn;
set<pair<int, int> > st;
pair<int, int> pr;
int cnt[N], ans[N];
bool check(int t) {
  st.clear();
  memset(cnt, 0, sizeof(cnt));
  int S = second;
  int last = -1, v = -1;
  for (int i = pn; i > 0; i--) {
    if (p[i].second.first == -1) {
      if (st.empty()) {
        return 0;
      }
      if (last == -1) {
        pr = *st.begin();
        S -= pr.first;
        if (S < 0) return 0;
        ans[p[i].second.second] = pr.second;
        last = pr.second;
        v = pr.first;
        cnt[pr.second]++;
        if (t == 1) {
          st.erase(st.begin());
          last = -1;
        }
      } else {
        cnt[last]++;
        ans[p[i].second.second] = last;
        if (cnt[last] == t) {
          st.erase(st.find(make_pair(v, last)));
          last = -1;
        }
      }
    } else {
      st.insert(p[i].second);
    }
  }
  return 1;
}
int main() {
  scanf("%d%d%d", &n, &m, &second);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &p[i].first);
    p[i].second.first = -1;
    p[i].second.second = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[m + i].first);
    p[m + i].second.second = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[m + i].second.first);
  }
  pn = n + m;
  sort(p + 1, p + pn + 1);
  int l = 0, r = m + 1;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (r == m + 1) {
    puts("NO");
  } else {
    puts("YES");
    check(r);
    for (int i = 1; i <= m; i++) printf("%d ", ans[i]);
  }
  return 0;
}
