#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const double eps = 1e-9;
const double INF = inf;
const double EPS = eps;
const int maxn = 123123;
pair<int, int> A[maxn];
pair<pair<int, int>, int> St[maxn];
set<pair<int, int> > S;
int B[maxn], C[maxn], Res[maxn], RRes[maxn];
int n, m, s;
bool solve(int t) {
  int cur = 0, pos = 0;
  int sum = 0;
  S.clear();
  while (cur * t < m) {
    while (pos < n && St[pos].first.first >= A[cur * t].first)
      S.insert(make_pair(St[pos].first.second, St[pos].second)), pos++;
    if (!S.size()) return 0;
    sum += S.begin()->first;
    Res[cur] = S.begin()->second;
    S.erase(S.begin());
    if (sum > s) return 0;
    cur++;
  }
  return 1;
}
int main() {
  int i;
  scanf("%d%d%d", &n, &m, &s);
  for (i = 0; i < m; i++) scanf("%d", &A[i].first), A[i].second = i;
  for (i = 0; i < n; i++) scanf("%d", &B[i]);
  for (i = 0; i < n; i++) scanf("%d", &C[i]);
  for (i = 0; i < n; i++) St[i] = make_pair(make_pair(B[i], C[i]), i);
  sort(A, A + m);
  sort(St, St + n);
  reverse(St, St + n);
  reverse(A, A + m);
  int l = 0, r = m;
  if (!solve(r)) {
    puts("NO");
    return 0;
  }
  while (r - l > 1)
    (solve((l + r) / 2)) ? (r = (l + r) / 2) : (l = (l + r) / 2);
  puts("YES");
  assert(solve(r));
  for (i = 0; i < m; i++) RRes[A[i].second] = Res[i / r];
  for (i = 0; i < m; i++) printf("%d ", RRes[i] + 1);
  printf("\n");
  ;
  return 0;
}
