#include <bits/stdc++.h>
using namespace std;
long S, N, M;
bool cmpbugs(const pair<long, long>& a, const pair<long, long>& b) {
  return a.first > b.first;
}
struct Student {
  long ind, price, know;
  friend bool operator<(const Student& a, const Student& b) {
    return a.price > b.price;
  }
};
bool cmp(const Student& a, const Student& b) { return a.know < b.know; }
int main() {
  cin >> N >> M >> S;
  vector<pair<long, long> > bugs(M);
  vector<Student> stud(N);
  for (int i = 0; i < M; i++) {
    cin >> bugs[i].first;
    bugs[i].second = i;
  }
  sort(bugs.begin(), bugs.end(), cmpbugs);
  for (int i = 0; i < N; i++) {
    cin >> stud[i].know;
    stud[i].ind = i;
  }
  for (int i = 0; i < N; i++) cin >> stud[i].price;
  sort(stud.begin(), stud.end(), cmp);
  vector<long> ans(M), fullans(M);
  long mi = 1, ma = M + 1, cur, last = 0;
  while (mi < ma) {
    long limit = S;
    bool ok = true;
    cur = (mi + ma) / 2;
    priority_queue<Student> Q;
    long laststud = N - 1;
    for (long j = 0; j < M; j += cur) {
      for (; laststud >= 0; laststud--)
        if (stud[laststud].know >= bugs[j].first) {
          Q.push(stud[laststud]);
        } else
          break;
      if (Q.empty()) {
        ok = false;
        break;
      }
      Student current = Q.top();
      Q.pop();
      limit -= current.price;
      if (limit >= 0)
        for (long k = j; k < min(j + cur, M); k++)
          ans[bugs[k].second] = current.ind;
      else {
        ok = false;
        break;
      }
    }
    if (ok) {
      last = cur;
      ma = cur;
      fullans = ans;
    } else
      mi = cur + 1;
  }
  if (last) {
    cout << "YES" << endl;
    for (long i = 0; i < M; i++) cout << fullans[i] + 1 << ' ';
  } else
    cout << "NO";
  return 0;
}
