#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100010];
int b[100010];
int c[100010];
pair<pair<int, int>, int> st[100010];
int ans[100010], ans_[100010];
int s, n, m;
int f(int x) {
  vector<int> v;
  int i, j;
  for (i = 0; i < m; i += x) {
    v.push_back(a[i].first);
  }
  priority_queue<pair<int, int> > q;
  long long cost = 0;
  for (i = j = 0; i < v.size(); i++) {
    while (j < n && v[i] <= st[j].first.first) {
      q.push(make_pair(-st[j].first.second, st[j].second));
      j++;
    }
    if (!q.size()) return 0;
    cost -= q.top().first;
    ans[i * x] = q.top().second;
    q.pop();
  }
  return cost <= s;
}
int main() {
  scanf("%d%d%d", &n, &m, &s);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    a[i] = make_pair(x, i);
  }
  sort(a, a + m);
  reverse(a, a + m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &c[i]);
    st[i] = make_pair(make_pair(b[i], c[i]), i);
  }
  int can = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] >= a[0].first && c[i] <= s) {
      can = 1;
    }
  }
  if (!can) {
    puts("NO");
    return 0;
  }
  sort(st, st + n);
  reverse(st, st + n);
  int lo = 0, hi = m, mid;
  while (lo + 1 < hi) {
    mid = (lo + hi) / 2;
    if (f(mid)) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  puts("YES");
  f(hi);
  for (int i = 0; i < m; i++) {
    if (i % hi) {
      ans[i] = ans[i - 1];
    }
  }
  for (int i = 0; i < m; i++) {
    ans_[a[i].second] = ans[i];
  }
  for (int i = 0; i < m; i++) {
    printf("%d ", ans_[i] + 1);
  }
  printf("\n");
  return 0;
}
