#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m, s, tot;
pair<int, int> prob[111111];
pair<pair<int, int>, int> stud[111111], heap[111111];
bool cmp1(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.first == b.first.first) return a.first.second < b.first.second;
  return a.first.first > b.first.first;
}
bool cmp2(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.second == b.first.second) return a.first.first < b.first.first;
  return a.first.second > b.first.second;
}
void pushup() {
  int now = tot;
  while (now > 1 && !cmp2(heap[now], heap[now / 2]))
    swap(heap[now], heap[now / 2]), now /= 2;
}
void pushdown() {
  int now = 1;
  while (1) {
    if (now * 2 <= tot) {
      if (now * 2 + 1 <= tot) {
        if (cmp2(heap[now], heap[2 * now + 1]) &&
            cmp2(heap[2 * now], heap[2 * now + 1]))
          swap(heap[now], heap[2 * now + 1]), now = (2 * now + 1);
        else if (cmp2(heap[now], heap[2 * now]) &&
                 !cmp2(heap[2 * now], heap[2 * now + 1]))
          swap(heap[now], heap[2 * now]), now *= 2;
        else
          break;
      } else {
        if (cmp2(heap[now], heap[2 * now]))
          swap(heap[now], heap[2 * now]), now *= 2;
        else
          break;
      }
    } else
      break;
  }
}
void push(pair<pair<int, int>, int> a) {
  heap[++tot] = a;
  pushup();
}
void pop() {
  heap[1] = heap[tot--];
  pushdown();
}
int ans[111111];
bool check(int x) {
  int i, j, k;
  pair<pair<int, int>, int> tem;
  long long re = 0;
  for (i = j = 0; i < m; i += x) {
    for (; j < n; ++j) {
      if (stud[j].first.first >= prob[i].first)
        push(stud[j]);
      else
        break;
    }
    if (tot > 0) {
      tem = heap[1];
      pop();
      re += tem.first.second;
      for (int k = (int)(i); k <= (int)(min(i + x, m) - 1); ++k)
        ans[prob[k].second] = tem.second;
    } else
      return false;
  }
  tot = 0;
  if (re <= s)
    return true;
  else
    return false;
}
int main() {
  int i, j, k, x, y, z, ca = 1, re = 0;
  scanf("%d%d%d", &(n), &(m), &(s));
  for (int i = 0; i < (int)(m); ++i)
    scanf("%d", &(x)), prob[i] = make_pair(x, i);
  sort(prob, prob + m);
  reverse(prob, prob + m);
  for (int i = 0; i < (int)(n); ++i) scanf("%d", &(stud[i].first.first));
  for (int i = 0; i < (int)(n); ++i)
    scanf("%d", &(stud[i].first.second)), stud[i].second = i;
  sort(stud, stud + n, cmp1);
  int st = 0, en = m + 1, fl = 0;
  while (st + 1 < en) {
    int mid = (st + en) >> 1;
    if (check(mid))
      fl = 1, en = mid;
    else
      st = mid;
  }
  if (fl) {
    puts("YES");
    check(en);
    for (int i = 0; i < (int)(m); ++i) printf("%d ", ans[i] + 1);
  } else
    puts("NO");
  return 0;
}
