#include <bits/stdc++.h>
using namespace std;
const int64_t MAX = 1e5 + 5;
int64_t n, m, s;
vector<int64_t> ans(MAX), tmp(MAX);
vector<pair<int64_t, int64_t> > bugs(MAX);
vector<pair<int64_t, pair<int64_t, int64_t> > > students(MAX);
priority_queue<pair<int64_t, int64_t>, vector<pair<int64_t, int64_t> >,
               greater<pair<int64_t, int64_t> > >
    pq;
bool cmp1(const pair<int64_t, int64_t> &a, const pair<int64_t, int64_t> &b) {
  return a.first > b.first;
}
bool cmp2(const pair<int64_t, pair<int64_t, int64_t> > &a,
          const pair<int64_t, pair<int64_t, int64_t> > &b) {
  return a.first > b.first;
}
bool OK(int64_t days) {
  pq = priority_queue<pair<int64_t, int64_t>, vector<pair<int64_t, int64_t> >,
                      greater<pair<int64_t, int64_t> > >();
  int64_t j = 1, i = 1;
  int64_t total_cost = 0;
  while (i <= m) {
    while (students[j].first >= bugs[i].first && j <= n) {
      pq.push({students[j].second.first, students[j].second.second});
      j++;
    }
    if (pq.empty()) return false;
    int64_t low_cost_stud = pq.top().second;
    total_cost += pq.top().first;
    pq.pop();
    for (int64_t k = i; k <= (i + days - 1) && k <= m; k++)
      tmp[bugs[k].second] = low_cost_stud;
    i += days;
  }
  if (total_cost <= s) {
    for (int64_t i = 1; i <= m; i++) ans[i] = tmp[i];
    return true;
  }
  return false;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> s;
  int64_t max_bug = 0;
  for (int64_t i = 1; i <= m; i++) {
    cin >> bugs[i].first;
    max_bug = max(max_bug, bugs[i].first);
    bugs[i].second = i;
  }
  for (int64_t i = 1; i <= n; i++) cin >> students[i].first;
  bool possible = false;
  for (int64_t i = 1; i <= n; i++) {
    cin >> students[i].second.first;
    students[i].second.second = i;
    if (students[i].first >= max_bug && students[i].second.first <= s)
      possible = true;
  }
  if (!possible) {
    cout << "NO";
    return 0;
  }
  sort(bugs.begin() + 1, bugs.begin() + m + 1, cmp1);
  sort(students.begin() + 1, students.begin() + n + 1, cmp2);
  int64_t start = 1, end = m, mid;
  int64_t res;
  while (start <= end) {
    mid = (start + end) >> 1;
    if (OK(mid)) {
      res = mid;
      end = mid - 1;
    } else
      start = mid + 1;
  }
  cout << "YES" << endl;
  for (int64_t i = 1; i <= m; i++) cout << ans[i] << " ";
  return 0;
}
