#include <bits/stdc++.h>
using namespace std;
struct Y {
  int i;
  int b;
  int c;
  int a;
};
struct Z {
  int i;
  int a;
};
vector<Z> v(100000);
vector<Y> w(100000);
int n, m, s;
struct Comp {
  int operator()(Y a, Y b) { return a.c > b.c; }
};
int f(long long t) {
  priority_queue<Y, vector<Y>, Comp> pq;
  long long sum = 0;
  int j = 0;
  while (!pq.empty()) {
    pq.pop();
  }
  for (int i = 0; i < m; i += t) {
    while (j < n && w[j].b >= v[i].a) {
      pq.push(w[j]);
      ++j;
    }
    if (pq.empty()) {
      return -1;
    }
    Y tmp = pq.top();
    pq.pop();
    sum += tmp.c;
  }
  if (sum <= s) {
    return 1;
  }
  return -1;
}
vector<int> res(100000);
int g(long long t) {
  priority_queue<Y, vector<Y>, Comp> pq;
  long long sum = 0;
  int j = 0;
  while (!pq.empty()) {
    pq.pop();
  }
  for (int i = 0; i < m; i += t) {
    while (j < n && w[j].b >= v[i].a) {
      pq.push(w[j]);
      ++j;
    }
    if (pq.empty()) {
      return 1;
    }
    Y tmp = pq.top();
    pq.pop();
    sum += tmp.c;
    for (int k = 0; i + k < m && k < t; ++k) {
      res[v[i + k].i] = tmp.i;
    }
  }
  if (sum <= s) {
    return 1;
  }
  return -1;
}
long long bsearch_answer(long long l, long long r, int (*f)(long long t)) {
  while (l < r) {
    long long t = (l + r) / 2;
    if (!f(t)) {
      l = t;
      break;
    } else if (f(t) > 0) {
      r = t;
    } else {
      l = t + 1;
    }
  }
  return l;
}
int main(int argc, char *argv[]) {
  cin >> n >> m >> s;
  for (int i = 0; i < m; ++i) {
    v[i].i = i;
    cin >> v[i].a;
  }
  for (int i = 0; i < n; ++i) {
    w[i].i = i;
    cin >> w[i].b;
  }
  for (int i = 0; i < n; ++i) {
    cin >> w[i].c;
  }
  sort(v.rbegin(), v.rend(), [](Z a, Z b) { return a.a < b.a; });
  sort(w.rbegin(), w.rend(), [](Y a, Y b) { return a.b < b.b; });
  int t = bsearch_answer(1, 100001, f);
  if (t == 100001) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  g(t);
  for (int i = 0; i < m; ++i) {
    cout << res[i] + 1 << " ";
  }
  return 0;
}
