#include <bits/stdc++.h>
using namespace std;
pair<pair<int, int>, int> stud[100005];
pair<int, int> jobs[100005];
int ans[100005];
bool foo(pair<int, int> a, pair<int, int> b) { return (a.first > b.first); }
bool foo2(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  return (a.first.first > b.first.first);
}
int n, m, s;
bool check(int days) {
  int cost = 0;
  priority_queue<pair<int, int> > currcost;
  int done = 0;
  int i = 0;
  while (done < n) {
    while (i < m && stud[i].first.first >= jobs[done].first) {
      currcost.push(make_pair(-stud[i].first.second, stud[i].second));
      i++;
    }
    if (currcost.empty()) return false;
    cost -= currcost.top().first;
    if (cost > s) return false;
    currcost.pop();
    done += days;
  }
  return true;
}
void g(int days) {
  priority_queue<pair<int, int> > currcost;
  int done = 0;
  int j, i = 0;
  while (done < n) {
    while (i < m && stud[i].first.first >= jobs[done].first) {
      currcost.push(make_pair(-stud[i].first.second, stud[i].second));
      i++;
    }
    for (j = (int)0; j < (int)days; j++) {
      if (done >= n) break;
      ans[jobs[done].second] = currcost.top().second;
      done++;
    }
    currcost.pop();
  }
}
int main() {
  int i;
  cin >> m >> n >> s;
  for (i = (int)0; i < (int)n; i++) scanf("%d", &jobs[i].first);
  for (i = (int)0; i < (int)n; i++) jobs[i].second = i;
  for (i = (int)0; i < (int)m; i++) stud[i].second = i;
  for (i = (int)0; i < (int)m; i++) scanf("%d", &stud[i].first.first);
  for (i = (int)0; i < (int)m; i++) scanf("%d", &stud[i].first.second);
  sort(jobs, jobs + n, foo);
  sort(stud, stud + m, foo2);
  for (i = 0; i < m; i++)
    if (stud[i].first.first >= jobs[0].first && stud[i].first.second <= s)
      break;
  if (i == m) {
    cout << "NO";
    return 0;
  }
  int l = 1, h = n, m;
  m = (l + h) / 2;
  while (l < h - 1) {
    if (check(m))
      h = m;
    else
      l = m + 1;
    m = (l + h) / 2;
  }
  while (1) {
    if (check(l)) break;
    l++;
  }
  g(l);
  cout << "YES\n";
  for (i = (int)0; i < (int)n; i++) cout << ans[i] + 1 << " ";
  return 0;
}
