#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100011;
const int INF = 0x7f7f7f7f;
int cases;
template <class T>
inline void read(T& x) {
  int c;
  for (c = getchar(); ~c && c < 33; c = getchar())
    ;
  for (x = 0; c > 32; x = x * 10 + c - '0', c = getchar())
    ;
}
int n, m;
long long s;
vector<pair<int, int> > job;
struct node {
  int x, id, cnt;
  long long c;
  node() {}
  node(int a, int b, long long f) : x(a), id(b), c(f), cnt(0) {}
  bool operator<(const node& t) const { return x > t.x; }
};
struct cmp {
  bool operator()(const node& t1, const node& t2) const { return t1.c > t2.c; }
};
vector<node> stu;
int ans[MAXN];
bool check(int t) {
  long long tot = 0;
  int o = 0;
  priority_queue<node, vector<node>, cmp> Q;
  for (const auto& x : job) {
    for (; o < stu.size(); o++) {
      if (stu[o].x < x.first) break;
      Q.push(stu[o]);
    }
    if (Q.empty()) return false;
    auto now = Q.top();
    Q.pop();
    now.cnt++;
    tot += now.c;
    now.c = 0;
    ans[x.second] = now.id;
    if (tot > s) return false;
    if (now.cnt < t) Q.push(now);
  }
  return true;
}
int main() {
  int x;
  read(n), read(m), read(s);
  for (int i = 0; i < m; i++) {
    read(x);
    job.emplace_back(x, i);
  }
  sort(job.begin(), job.end(),
       [&](const pair<int, int>& t1, const pair<int, int>& t2) {
         return t1.first > t2.first;
       });
  for (int i = 0; i < n; i++) {
    read(x);
    stu.emplace_back(x, i + 1, 0);
  }
  for (int i = 0; i < n; i++) {
    read(stu[i].c);
  }
  sort(stu.begin(), stu.end());
  int L = 1, R = m, mid;
  while (R - L > 3) {
    mid = (L + R) >> 1;
    if (check(mid)) {
      R = mid;
    } else {
      L = mid;
    }
  }
  bool flag = 0;
  for (int i = L; i <= R; i++) {
    if (check(i)) {
      flag = 1;
      break;
    }
  }
  if (flag) {
    puts("YES");
    for (int i = 0; i < m; i++) {
      printf("%d%c", ans[i], i == m - 1 ? '\n' : ' ');
    }
  } else {
    puts("NO");
  }
}
