#include <bits/stdc++.h>
using namespace std;
int n, m, s, out[100100];
pair<int, int> cm[100100];
struct student {
  int b, cost, idx;
  bool operator<(const student &o) const { return b < o.b; }
};
student arr[100100];
bool can(int d) {
  int sum = 0, i = m - 1, j = n - 1;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  while (i >= 0) {
    while (j >= 0 && arr[j].b >= cm[i].first) {
      q.push(pair<int, int>(arr[j].cost, arr[j].idx));
      --j;
    }
    if (!q.size()) return 0;
    pair<int, int> cur = q.top();
    q.pop();
    sum += cur.first;
    if (sum > s) return 0;
    i -= d;
  }
  return 1;
}
void get(int d) {
  int i = m - 1, j = n - 1;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  while (i >= 0) {
    while (j >= 0 && arr[j].b >= cm[i].first) {
      q.push(pair<int, int>(arr[j].cost, arr[j].idx));
      --j;
    }
    pair<int, int> cur = q.top();
    q.pop();
    for (int z = 0; z < d && i >= 0; ++z, --i) out[cm[i].second] = cur.second;
  }
}
int main() {
  scanf("%d", &n), scanf("%d", &m), scanf("%d", &s);
  int mxcm = -1e9, mxb = -1e9;
  for (int i = 0; i < m; ++i)
    scanf("%d", &cm[i].first), mxcm = max(mxcm, cm[i].first), cm[i].second = i;
  for (int i = 0; i < n; ++i)
    scanf("%d", &arr[i].b), mxb = max(mxb, arr[i].b), arr[i].idx = i;
  for (int i = 0; i < n; ++i) scanf("%d", &arr[i].cost);
  sort(arr, arr + n);
  sort(cm, cm + m);
  if (mxcm > mxb) return puts("NO");
  int s = 1, e = m, md, bst = -1;
  while (s <= e) {
    md = s + ((e - s) >> 1);
    if (can(md))
      bst = md, e = md - 1;
    else
      s = md + 1;
  }
  if (bst == -1) return puts("NO");
  puts("YES");
  get(bst);
  for (int i = 0; i < m; ++i) printf("%d ", out[i] + 1);
}
