#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, s, l, h, mid, ans = -1, id, res[N], indecis[N];
pair<int, int> b[N];
struct student {
  int l, c, idx;
  student(int L = 0, int C = 0, int I = 0) { l = L, c = C, idx = I; }
  bool operator<(const student &o) const { return l < o.l; }
} st[N];
bool can(int mid, bool store = 0) {
  int sum = 0;
  priority_queue<pair<int, int> > q;
  for (int i = 0, j = n - 1; i < m; i += mid) {
    while (j >= 0) {
      if (st[j].l >= b[i].first) {
        q.push(make_pair(-st[j].c, j));
        --j;
      } else
        break;
    }
    if (q.empty()) return false;
    pair<int, int> p = q.top();
    q.pop();
    p.first *= -1;
    if (p.first + sum > s) return false;
    if (store) indecis[id++] = p.second;
    sum += p.first;
  }
  return true;
}
int main(int argc, char **argv) {
  scanf("%d%d%d", &n, &m, &s);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &b[i].first);
    b[i].second = i;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &st[i].l);
    st[i].idx = i;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &st[i].c);
  }
  sort(b, b + m, greater<pair<int, int> >());
  sort(st, st + n);
  l = 1, h = m;
  while (l <= h) {
    mid = (l + h) >> 1;
    if (can(mid)) {
      ans = mid;
      h = mid - 1;
    } else
      l = mid + 1;
  }
  if (ans == -1) return puts("NO");
  puts("YES");
  can(ans, 1);
  for (int i = 0; i < m; ++i) res[b[i].second] = st[indecis[i / ans]].idx;
  for (int i = 0; i < m; ++i) printf("%d ", res[i] + 1);
  return 0;
}
