#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
int N, M, S;
vector<pair<int, int> > b;
vector<pair<pair<int, int>, int> > s;
vector<pair<int, int> > b2;
vector<pair<pair<int, int>, int> > s2;
int ans[MAX_N + 1];
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    pq;
bool chk(int x) {
  long long cost = 0;
  while (!b.empty()) b.pop_back();
  while (!s.empty()) s.pop_back();
  for (int i = 0; i < b2.size(); i++) {
    b.push_back(b2[i]);
  }
  for (int i = 0; i < s2.size(); i++) {
    s.push_back(s2[i]);
  }
  while (!pq.empty()) pq.pop();
  while (!b.empty()) {
    while (!s.empty() && s.back().first.first >= b.back().first) {
      pq.push({s.back().first.second, s.back().second});
      s.pop_back();
    }
    if (pq.empty()) {
      return false;
    }
    pair<int, int> now = pq.top();
    pq.pop();
    cost += (long long)now.first;
    for (int i = 0; i < x; i++) {
      if (b.empty()) break;
      pair<int, int> p = b.back();
      b.pop_back();
      ans[p.second] = now.second;
    }
  }
  return cost <= (long long)S;
}
int main() {
  scanf("%d%d%d", &N, &M, &S);
  for (int i = 0; i < M; i++) {
    int x;
    scanf("%d", &x);
    b2.push_back({x, i});
  }
  for (int i = 0; i < N; i++) {
    int x;
    scanf("%d", &x);
    s2.push_back({{x, 0}, i});
  }
  for (int i = 0; i < N; i++) {
    int x;
    scanf("%d", &x);
    s2[i].first.second = x;
  }
  sort(b2.begin(), b2.end());
  sort(s2.begin(), s2.end());
  int st = 0, ed = 100000, m;
  while (st < ed) {
    m = (st + ed) / 2;
    if (chk(m))
      ed = m;
    else
      st = m + 1;
  }
  if (chk(st)) {
    printf("YES\n");
    for (int i = 0; i < M; i++) {
      printf("%d ", ans[i] + 1);
    }
  } else {
    printf("NO");
  }
  return 0;
}
