#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "avx,avx2,fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),
      cout << fixed << setprecision(20);
  long long n, m, s;
  cin >> n >> m >> s;
  vector<pair<long long, long long> > bg(m);
  vector<long long> ans(m, -1);
  for (int i = 0; i < m; i++) {
    cin >> bg[i].first;
    bg[i].second = i;
  }
  sort(bg.rbegin(), bg.rend());
  vector<pair<pair<long long, long long>, long long> > st(n);
  for (int i = 0; i < n; i++) {
    cin >> st[i].first.first;
  }
  for (int i = 0; i < n; i++) {
    cin >> st[i].first.second;
    st[i].second = i + 1;
  }
  sort(st.rbegin(), st.rend());
  long long L = 0, R = m + 1;
  while (R - L > 1) {
    long long mid = (R + L) / 2;
    long long fl = 1;
    long long ss = s;
    multiset<pair<long long, long long> > mem;
    map<long long, long long> mem2;
    vector<long long> ans_(m);
    long long nw = 0;
    for (int i = 0; i < m; i++) {
      while (nw < n && st[nw].first.first >= bg[i].first) {
        mem.insert({st[nw].first.second, st[nw].second});
        nw++;
      }
      if (!mem.size()) {
        fl = 0;
        break;
      }
      auto keks = *mem.begin();
      ans_[bg[i].second] = keks.second;
      ss -= keks.first;
      mem2[keks.second]++;
      mem.erase(mem.find(keks));
      if (mem2[keks.second] != mid) mem.insert({0, keks.second});
    }
    if (ss < 0) {
      fl = 0;
    }
    if (fl) {
      R = mid;
      ans = ans_;
    } else {
      L = mid;
    }
  }
  if (R == m + 1) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (auto i : ans) {
    cout << i << " ";
  }
}
