#include <bits/stdc++.h>
using namespace std;
struct Student {
  int b, c, id;
  bool operator<(const Student &other) const { return c > other.c; }
  static bool byB(const Student &a, const Student &b) { return a.b < b.b; }
} stu[100010];
struct Work {
  int a, id;
  bool operator<(const Work &other) const { return a < other.a; }
} work[100010];
int done[100010];
bool check(int n, int m, int s, int days) {
  int k = n - 1, i = m - 1, used = 0;
  priority_queue<Student> que;
  Student now;
  while (k >= 0) {
    while (i >= 0 && stu[i].b >= work[k].a) {
      que.push(stu[i--]);
    }
    if (que.size() == 0) return false;
    now = que.top();
    que.pop();
    used += now.c;
    if (used > s) return false;
    for (int j = 0; j < days && k >= 0; ++j, --k) {
      done[work[k].id] = now.id;
    }
  }
  return true;
}
int main() {
  int n, m, s;
  cin >> m >> n >> s;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &work[i].a);
    work[i].id = i;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &stu[i].b);
    stu[i].id = i + 1;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &stu[i].c);
  }
  sort(work, work + n);
  sort(stu, stu + m, Student::byB);
  int left = 0, right = n;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (check(n, m, s, mid) == false) {
      left = mid + 1;
    } else {
      right = mid - 1;
    }
  }
  if (check(n, m, s, left)) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      printf("%d ", done[i]);
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
