#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double PI = acos(-1);
const double EPS = 1e-8;
int a[100000];
int b[100000];
int c[100000];
pair<int, int> pa[100000];
pair<int, int> pb[100000];
int ans[100000];
int n, m, s;
bool ok(int x) {
  if (x == 0) return 0;
  int idx = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      Q;
  int cnt = x;
  int sum = 0;
  int cur = -1;
  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < (int)m; ++i) {
    while (idx < n && pb[idx].first >= pa[i].first) {
      int j = pb[idx].second;
      Q.push(pair<int, int>(c[j], j));
      idx++;
    }
    if (cnt == x) {
      if (Q.size() && sum + Q.top().first <= s) {
        cur = Q.top().second;
        sum += Q.top().first;
        Q.pop();
        cnt = 1;
      } else {
        return 0;
      }
    } else {
      cnt++;
    }
    ans[pa[i].second] = cur;
  }
  return 1;
}
int main() {
  while (cin >> n >> m >> s) {
    for (int i = 0; i < (int)m; ++i) scanf("%d", a + i);
    for (int i = 0; i < (int)n; ++i) scanf("%d", b + i);
    for (int i = 0; i < (int)n; ++i) scanf("%d", c + i);
    for (int i = 0; i < (int)m; ++i) pa[i] = pair<int, int>(a[i], i);
    for (int i = 0; i < (int)n; ++i) pb[i] = pair<int, int>(b[i], i);
    sort(pa, pa + m, greater<pair<int, int> >());
    sort(pb, pb + n, greater<pair<int, int> >());
    int low = 0, high = 1000000002;
    while (low + 1 < high) {
      int mid = low + high >> 1;
      if (ok(mid)) {
        high = mid;
      } else {
        low = mid;
      }
    }
    ok(high);
    if (high == 1000000002) {
      puts("NO");
    } else {
      puts("YES");
      for (int i = 0; i < (int)m; ++i) {
        printf("%d%c", ans[i] + 1, i != m - 1 ? ' ' : '\n');
      }
    }
  }
}
