#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<pair<long long, long long>, long long> > q;
pair<long long, long long> bug[100010];
pair<pair<long long, long long>, long long> stud[100010];
long long ans[100010];
int main() {
  int i;
  long long n, m, s, lo, hi, mid, cur;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &s);
  for (i = 0; i < m; ++i) {
    scanf("%lld", &bug[i].first);
    bug[i].second = i;
  }
  for (i = 0; i < n; ++i) {
    scanf("%lld", &stud[i].first.first);
    stud[i].second = i;
  }
  for (i = 0; i < n; ++i) scanf("%lld", &stud[i].first.second);
  sort(bug, bug + m);
  sort(stud, stud + n);
  if (stud[n - 1].first.first < bug[m - 1].first) {
    printf("NO\n");
    return 0;
  } else {
    bool f;
    lo = 1;
    hi = 1000000000;
    mid = (lo + hi) / 2;
    long long cost;
    while (lo < hi) {
      cost = 0;
      f = 0;
      cur = n - 1;
      while (!q.empty()) {
        q.pop();
      }
      for (i = m - 1; i >= 0; --i) {
        if (cur >= 0) {
          while (stud[cur].first.first >= bug[i].first) {
            q.push(make_pair(make_pair(-stud[cur].first.second, 0),
                             stud[cur].second));
            --cur;
            if (cur < 0) break;
          }
        }
        if (!q.empty()) {
          pair<pair<long long, long long>, long long> p = q.top();
          q.pop();
          cost = cost - p.first.first;
          ans[bug[cur].second] = p.second;
          if (p.first.second + 1 < mid)
            q.push(make_pair(make_pair(0, p.first.second + 1), p.second));
        } else {
          f = 1;
          break;
        }
      }
      if (f)
        lo = mid + 1;
      else if (cost > s)
        lo = mid + 1;
      else
        hi = mid;
      mid = (lo + hi) / 2;
    }
    if (mid == 1000000000)
      printf("NO\n");
    else {
      printf("YES\n");
      cost = 0;
      f = 0;
      cur = n - 1;
      while (!q.empty()) {
        q.pop();
      }
      for (i = m - 1; i >= 0; --i) {
        if (cur >= 0) {
          while (stud[cur].first.first >= bug[i].first) {
            q.push(make_pair(make_pair(-stud[cur].first.second, 0),
                             stud[cur].second));
            --cur;
            if (cur < 0) break;
          }
        }
        if (!q.empty()) {
          pair<pair<long long, long long>, long long> p = q.top();
          q.pop();
          cost = cost - p.first.first;
          ans[bug[i].second] = p.second;
          if (p.first.second + 1 < mid)
            q.push(make_pair(make_pair(0, p.first.second + 1), p.second));
        } else {
          f = 1;
          break;
        }
      }
      for (i = 0; i < m; ++i) printf("%lld ", ans[i] + 1);
    }
  }
}
