#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int a[MAXN];
int b[MAXN];
int c[MAXN];
int n, m, s;
struct node {
  int x, y;
  int index;
  friend bool operator<(node a, node b) { return a.y > b.y; }
};
priority_queue<node> q;
template <class T>
inline bool scan_d(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
node nn[MAXN];
bool cmp(node a, node b) { return a.x > b.x; }
int AA[MAXN];
bool cmp11(int t1, int t2) { return a[t1] > a[t2]; }
int BB[MAXN];
bool check(int pp) {
  while (!q.empty()) q.pop();
  int i = 0, j = 0;
  long long ret = 0;
  while (i < m) {
    while (j < n && nn[j].x >= a[i]) {
      q.push(nn[j]);
      j++;
    }
    if (q.empty()) return false;
    node tmp = q.top();
    q.pop();
    ret += tmp.y;
    if (ret > s) return false;
    int ccc = pp;
    while (ccc && i < m) {
      ccc--;
      BB[AA[i]] = tmp.index;
      i++;
    }
  }
  return true;
}
int main() {
  while (scanf("%d%d%d", &n, &m, &s) == 3) {
    for (int i = 0; i < m; i++) {
      scan_d(a[i]);
    }
    for (int i = 0; i < n; i++) scan_d(b[i]);
    for (int i = 0; i < n; i++) scan_d(c[i]);
    for (int i = 0; i < m; i++) AA[i] = i;
    sort(AA, AA + m, cmp11);
    sort(a, a + m);
    reverse(a, a + m);
    for (int i = 0; i < n; i++) {
      nn[i].x = b[i];
      nn[i].y = c[i];
      nn[i].index = i + 1;
    }
    sort(nn, nn + n, cmp);
    if (check(m) == false) {
      printf("NO\n");
      continue;
    }
    int l = 1, r = m;
    int ans;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (check(mid)) {
        ans = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    check(ans);
    printf("YES\n");
    for (int i = 0; i < m; i++) {
      printf("%d", BB[i]);
      if (i < m - 1)
        printf(" ");
      else
        printf("\n");
    }
  }
  return 0;
}
