#include <bits/stdc++.h>
using namespace std;
const int nmax = 100010;
int n, m, s;
pair<int, int> a[nmax];
pair<int, int> b[nmax];
pair<pair<int, int>, int> ax[nmax];
int sol[nmax];
pair<int, int> rev(pair<int, int> p) {
  swap(p.first, p.second);
  p.first *= -1;
  return p;
}
bool solve(int x) {
  int sum = 0;
  priority_queue<pair<pair<int, int>, int> > pq;
  int j = n;
  for (int i = m; i >= 1; --i) {
    while (ax[j].first.first >= a[i].first) {
      pq.push(make_pair(rev(ax[j].first), ax[j].second));
      --j;
    }
    if (pq.empty()) return 0;
    pair<pair<int, int>, int> good = pq.top();
    pq.pop();
    sum += -good.first.first;
    if (sum > s) return 0;
    for (int k = 1; k < x && i > 0; ++k) {
      sol[a[i].second] = good.second;
      i--;
    }
    if (i > 0) {
      sol[a[i].second] = good.second;
    }
  }
  return sum <= s;
}
int bs(int left, int right) {
  if (right - left < 2) {
    if (solve(left)) return left;
    if (solve(right)) return right;
    return -1;
  }
  int middle = (left + right) / 2;
  if (solve(middle)) return bs(left, middle);
  return bs(middle + 1, right);
}
int main() {
  cin >> n >> m >> s;
  if (m == 0) {
    cout << "YES\n";
    return 0;
  }
  for (int i = 1; i <= m; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 1; i <= n; ++i) cin >> ax[i].first.first;
  for (int i = 1; i <= n; ++i) cin >> ax[i].first.second;
  for (int i = 1; i <= n; ++i) ax[i].second = i;
  sort(a + 1, a + m + 1);
  sort(ax + 1, ax + n + 1);
  if (bs(1, 2 * m) == -1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= m; ++i) cout << sol[i] << ' ';
    cout << '\n';
  }
}
