#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, s;
int ans[N];
struct Student {
  int b, c, id;
  bool operator<(Student b) const { return c > b.c; }
} stu[N];
struct Bug {
  int a, id;
  bool operator<(Bug b) const { return a < b.a; }
} bug[N];
int cmp(Student a, Student b) { return a.b > b.b; }
void solve(int time) {
  int limit = s, cnt = 0;
  priority_queue<Student> Q;
  for (int i = m - 1; i >= 0; i -= time) {
    while (stu[cnt].b >= bug[i].a && cnt != n) Q.push(stu[cnt++]);
    Student t = Q.top();
    Q.pop();
    limit -= t.c;
    int e = i - time + 1;
    if (e < 0) e = 0;
    for (int j = i; j >= e; j--) ans[bug[j].id] = t.id;
  }
}
bool OK(int time) {
  int limit = s, cnt = 0;
  priority_queue<Student> Q;
  for (int i = m - 1; i >= 0; i -= time) {
    while (stu[cnt].b >= bug[i].a && cnt != n) Q.push(stu[cnt++]);
    if (Q.empty()) return false;
    Student t = Q.top();
    Q.pop();
    if (limit < t.c) return false;
    limit -= t.c;
  }
  return true;
}
void Deal() {
  if (OK(m) == false) {
    printf("NO\n");
    return;
  }
  int low = 0, high = m, tmp;
  while (low <= high) {
    int mid = (low + high) >> 1;
    if (OK(mid))
      high = mid - 1, tmp = mid;
    else
      low = mid + 1;
  }
  high = tmp;
  solve(high);
  printf("YES\n");
  for (int i = 0; i < m; i++) printf(i == m - 1 ? "%d\n" : "%d ", ans[i] + 1);
}
int main() {
  int i;
  scanf("%d%d%d", &n, &m, &s);
  for (i = 0; i < m; i++) {
    scanf("%d", &bug[i].a);
    bug[i].id = i;
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &stu[i].b);
    stu[i].id = i;
  }
  for (i = 0; i < n; i++) scanf("%d", &stu[i].c);
  sort(bug, bug + m);
  sort(stu, stu + n, cmp);
  Deal();
  return 0;
}
