#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e5 + 5;
long long n, m, s;
vector<pair<long long, long long> > bug;
vector<pair<long long, long long> > stud;
vector<long long> pass;
long long allot[SIZE];
struct cmp {
  bool operator()(pair<long long, long long> const& lhs,
                  pair<long long, long long> const& rhs) {
    return lhs.first < rhs.first;
  }
};
long long ok(long long val) {
  long long i = 0;
  long long j = 0;
  long long temp = s;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      pq;
  while (i < bug.size()) {
    while (stud[j].first >= bug[i].first && j < stud.size()) {
      pq.push(make_pair(pass[stud[j].second], stud[j].second));
      j++;
    }
    if (pq.size() == 0) return 0;
    pair<long long, long long> cheap = pq.top();
    pq.pop();
    if (temp < cheap.first) return 0;
    temp -= cheap.first;
    long long days = 0;
    while (i < bug.size() && days < val) {
      allot[bug[i].second] = cheap.second;
      i++;
      days++;
    }
  }
  return 1;
}
long long lowerbound(long long l, long long h) {
  long long mid = (l + h) / 2;
  if (l == h) return mid;
  if (ok(mid)) {
    return lowerbound(l, mid);
  } else
    return lowerbound(mid + 1, h);
}
int main() {
  cin.sync_with_stdio(0);
  cin >> n >> m >> s;
  for (int i = 0; i <= m - 1; i++) {
    long long a;
    cin >> a;
    bug.push_back(make_pair(a, i));
  }
  sort(bug.begin(), bug.end());
  reverse(bug.begin(), bug.end());
  for (int i = 0; i <= n - 1; i++) {
    long long a;
    cin >> a;
    stud.push_back(make_pair(a, i));
  }
  sort(stud.begin(), stud.end());
  reverse(stud.begin(), stud.end());
  for (int i = 0; i <= n - 1; i++) {
    long long a;
    cin >> a;
    pass.push_back(a);
  }
  long long l = 0;
  long long h = bug.size();
  long long temp = lowerbound(l, h);
  if (ok(temp)) {
    cout << "YES\n";
    for (int i = 0; i <= m - 1; i++) cout << allot[i] + 1 << " ";
  } else
    cout << "NO";
  return 0;
}
