#include <bits/stdc++.h>
int n, m, s;
int ans, who[1 << 17];
struct bug_st {
  int need, id;
  bool operator<(const bug_st& bug) const { return need > bug.need; }
} bug[1 << 17];
struct student_st {
  int id, ability, cost;
  bool operator<(const student_st& student) const {
    return ability > student.ability;
  }
} student[1 << 17];
std::priority_queue<std::pair<int, int> > Q;
bool check(int days) {
  while (!Q.empty()) {
    Q.pop();
  }
  int j = 0, cost = 0;
  for (int i = 0; i < m; i += days) {
    while (j < n && student[j].ability >= bug[i].need) {
      Q.push(std::make_pair(-student[j].cost, student[j].id));
      ++j;
    }
    if (Q.empty()) {
      return false;
    }
    int alpha = -Q.top().first;
    int beta = Q.top().second;
    cost += alpha;
    if (cost > s) {
      return false;
    }
    Q.pop();
  }
  return true;
}
bool solve(int days) {
  while (!Q.empty()) {
    Q.pop();
  }
  int j = 0, cost = 0;
  for (int i = 0; i < m; i += days) {
    while (j < n && student[j].ability >= bug[i].need) {
      Q.push(std::make_pair(-student[j].cost, student[j].id));
      ++j;
    }
    if (Q.empty()) {
      return false;
    }
    int alpha = -Q.top().first;
    int beta = Q.top().second;
    cost += alpha;
    if (cost > s) {
      return false;
    }
    for (int k = 0; k < days && i + k < m; ++k) {
      who[bug[i + k].id] = beta;
    }
    Q.pop();
  }
  return true;
}
int bs(int l, int r) {
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (check(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  return check(l) ? l : r;
}
int main() {
  while (scanf("%d%d%d", &n, &m, &s) == 3) {
    for (int i = 0; i < m; ++i) {
      bug[i].id = i;
      scanf("%d", &bug[i].need);
    }
    std::sort(bug, bug + m);
    for (int i = 0; i < n; ++i) {
      student[i].id = i;
      scanf("%d", &student[i].ability);
    }
    for (int i = 0; i < n; ++i) {
      scanf("%d", &student[i].cost);
    }
    std::sort(student, student + n);
    int ans = bs(1, m);
    if (!check(ans)) {
      puts("NO");
      continue;
    }
    solve(ans);
    puts("YES");
    for (int i = 0; i < m; ++i) {
      printf("%d%c", who[i] + 1, i == m - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
