#include <bits/stdc++.h>
using namespace std;
int nrb, nrs, i, B[100666];
pair<int, int> A[100666];
int per[100666], ind[100666];
long long smax;
int result[100666];
struct comp {
  bool operator()(int i1, int i2) { return A[i1].second > A[i2].second; }
};
priority_queue<int, vector<int>, comp> Que;
bool comp(int i1, int i2) { return B[i1] < B[i2]; }
bool ck(int nrt) {
  int i, dr = nrs;
  long long cost = 0;
  while (Que.empty() == false) Que.pop();
  for (i = nrb; i > 0; i -= nrt) {
    while (dr > 0 && A[per[dr]].first >= B[ind[i]]) {
      Que.push(per[dr]);
      --dr;
    }
    if (Que.empty() == true) return false;
    int I = Que.top();
    Que.pop();
    cost += (long long)A[I].second;
    for (int j = i; j > i - nrt && j > 0; --j) result[ind[j]] = I;
  }
  if (cost > smax) return false;
  return true;
}
int bs(int lmax) {
  int pos, step;
  for (step = 1; step <= lmax; step <<= 1)
    ;
  for (pos = 0; step; step >>= 1)
    if (pos + step <= lmax && ck(pos + step) == false) pos += step;
  return pos + 1;
}
bool comp2(int i1, int i2) { return A[i1].first < A[i2].first; }
int main() {
  cin >> nrs >> nrb >> smax;
  for (i = 1; i <= nrb; ++i) cin >> B[i], ind[i] = i;
  for (i = 1; i <= nrs; ++i) cin >> A[i].first;
  for (i = 1; i <= nrs; ++i) cin >> A[i].second, per[i] = i;
  ;
  sort(per + 1, per + nrs + 1, comp2);
  sort(ind + 1, ind + nrb + 1, comp);
  int V = bs(nrb);
  if (ck(V) == false) {
    cout << "NO";
    return 0;
  } else {
    cout << "YES" << '\n';
    for (i = 1; i <= nrb; ++i) cout << result[i] << '\n';
  }
  return 0;
}
