#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 10;
int n, m, s;
int a[MAXN], b[MAXN], c[MAXN];
vector<pair<pair<int, int>, int> > v;
vector<pair<int, int> > p;
bool check(int mid) {
  int st = n - 1, gv = 0;
  priority_queue<pair<int, int> > te;
  for (int i = m - 1; i >= 0;) {
    int nxt = max(i - mid + 1, 0);
    int cur = p[i].first;
    while (st >= 0 && v[st].first.first >= cur)
      te.push(make_pair(-v[st].first.second, v[st].second)), st--;
    if (te.size() == 0) return false;
    gv += -te.top().first;
    if (gv > s) return false;
    te.pop();
    i = nxt - 1;
  }
  return true;
}
int res[MAXN];
void gao(int ans) {
  int st = n - 1, gv = 0;
  priority_queue<pair<int, int> > te;
  if (ans == -1)
    printf("NO\n");
  else {
    for (int i = m - 1; i >= 0;) {
      int nxt = max(i - ans + 1, 0);
      int cur = p[i].first;
      while (st >= 0 && v[st].first.first >= cur)
        te.push(make_pair(-v[st].first.second, v[st].second)), st--;
      for (int j = i; j >= nxt; j--) res[p[j].second] = te.top().second;
      te.pop();
      i = nxt - 1;
    }
    printf("YES\n");
    for (int i = 0; i < m; i++) printf("%d ", res[i] + 1);
    printf("\n");
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &s);
  for (int i = 0; i < m; i++)
    scanf("%d", &a[i]), p.push_back(make_pair(a[i], i));
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < n; i++)
    scanf("%d", &c[i]), v.push_back(make_pair(make_pair(b[i], c[i]), i));
  sort(p.begin(), p.end());
  sort(v.begin(), v.end());
  int l = 1, r = m, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid, r = mid - 1;
    } else
      l = mid + 1;
  }
  gao(ans);
  return 0;
}
