#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10;
pair<int, int> bug[N];
vector<pair<int, pair<int, int>>> v;
int n, m, s;
vector<int> ok(int d) {
  vector<int> res(m + 1, 0);
  multimap<int, int> mp;
  long long cost = 0;
  int idx = n - 1;
  pair<int, int> stu{0, 0};
  for (int i = 0; i < m; ++i) {
    while (idx >= 0 && v[idx].first >= bug[i].first)
      mp.insert({v[idx].second.first, v[idx].second.second}), --idx;
    if (stu.first)
      stu.first--;
    else {
      if (mp.empty()) {
        res[1] = 0;
        return res;
      }
      stu.first = d - 1, stu.second = mp.begin()->second,
      cost += mp.begin()->first;
      mp.erase(mp.begin());
    }
    res[bug[i].second] = stu.second;
    if (cost > s) {
      res[1] = 0;
      return res;
    }
  }
  return res;
}
void bs() {
  int l = 1, r = 1e5;
  vector<int> ans;
  while (l <= r) {
    int mid = l + r >> 1;
    vector<int> res = ok(mid);
    if (res[1]) {
      ans = res, r = mid - 1;
    } else
      l = mid + 1;
  }
  if (ans.empty())
    cout << "NO";
  else {
    cout << "YES\n";
    for (int i = 1; i <= m; ++i) cout << ans[i] << " ";
  }
}
int main() {
  cin >> n >> m >> s;
  int mxBug = INT_MIN, mxAb = INT_MIN;
  for (int i = 0; i < m; ++i) {
    cin >> bug[i].first;
    bug[i].second = i + 1;
    mxBug = max(mxBug, bug[i].first);
  }
  v.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i].first;
    mxAb = max(mxAb, v[i].first);
  }
  for (int i = 0; i < n; ++i) {
    cin >> v[i].second.first;
    v[i].second.second = i + 1;
  }
  if (mxAb < mxBug) return cout << "NO", 0;
  sort(v.begin(), v.end());
  sort(bug, bug + m);
  reverse(bug, bug + m);
  bs();
  return 0;
}
