#include <bits/stdc++.h>
using namespace std;
struct dog {
  int id;
  int val;
  dog(){};
  dog(int x, int y) {
    id = x;
    val = y;
  }
  friend bool operator<(dog a, dog b) { return a.val > b.val; }
};
struct cat {
  int id;
  int abi;
  int val;
} stu[100001];
struct pig {
  int id;
  int abi;
} bugs[100001];
int n, m, s;
int have_used[100001];
int by[100001];
int final[100001];
priority_queue<dog> k;
int cmp(const cat& a, const cat& b) {
  if (a.abi > b.abi)
    return 1;
  else
    return 0;
}
int cnp(const pig& a, const pig& b) {
  if (a.abi > b.abi)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> m >> s;
  for (int i = 1; i <= m; i++) scanf("%d", &bugs[i].abi);
  for (int i = 1; i <= m; i++) bugs[i].id = i;
  for (int i = 1; i <= n; i++) scanf("%d", &stu[i].abi);
  for (int i = 1; i <= n; i++) scanf("%d", &stu[i].val);
  for (int i = 1; i <= n; i++) stu[i].id = i;
  sort(stu + 1, stu + 1 + n, cmp);
  sort(bugs + 1, bugs + 1 + m, cnp);
  int ll = 1;
  int rr = m;
  int mid, ans;
  dog a;
  dog b;
  bool done = 0;
  while (ll <= rr) {
    mid = (ll + rr) / 2;
    int j = 1;
    int money = 0;
    memset(have_used, 0, sizeof(have_used));
    while (!k.empty()) k.pop();
    bool ok = 0;
    for (int i = 1; i <= m; i++) {
      while (stu[j].abi >= bugs[i].abi && j <= n) {
        a.id = stu[j].id;
        a.val = stu[j].val;
        k.push(a);
        j++;
      }
      bool con = 0;
      while (!k.empty()) {
        b = k.top();
        if (have_used[b.id] < mid) {
          have_used[b.id]++;
          by[bugs[i].id] = b.id;
          money += b.val;
          if (money > s) break;
          if (b.val != 0) {
            k.pop();
            a.id = b.id;
            a.val = 0;
            k.push(a);
          }
          con = 1;
          break;
        } else {
          k.pop();
        }
      }
      if (!con) break;
      if (i == m) ok = 1;
    }
    if (ok) {
      for (int i = 1; i <= m; i++) final[i] = by[i];
      done = 1;
      rr = mid - 1;
    } else
      ll = mid + 1;
  }
  if (done) {
    cout << "YES" << endl;
    for (int i = 1; i <= m; i++) cout << final[i] << " ";
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
