#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
template <typename T>
inline T Abs(T x) {
  return (x >= 0) ? x : -x;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
template <typename T>
inline int bit(T mask, int b) {
  return (b >= 0 && (mask & (T(1) << b)) != 0) ? 1 : 0;
}
inline int nextInt() {
  int x;
  if (scanf("%d", &x) != 1) throw;
  return x;
}
inline long long nextInt64() {
  long long x;
  if (scanf("%lld", &x) != 1) throw;
  return x;
}
inline double nextDouble() {
  double x;
  if (scanf("%lf", &x) != 1) throw;
  return x;
}
const int INF = (int)1E9 + 100;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 100100;
struct bug {
  int diff, id;
  bool operator<(const bug &b) const { return diff > b.diff; }
};
struct student {
  int exp, cost, id;
  bool operator<(const student &s) const { return exp > s.exp; }
};
int n, m, s, size, rr[MAXN];
student a[MAXN];
bug b[MAXN];
int solve(int D) {
  size = 0;
  int ans = 0, p = 0;
  set<pair<int, int> > st;
  for (int i = 0; i < m; i += D) {
    while (p < n && a[p].exp >= b[i].diff) {
      st.insert(make_pair(a[p].cost, a[p].id));
      p++;
    }
    if (st.empty()) return INF;
    pair<int, int> value = *st.begin();
    rr[size++] = value.second;
    st.erase(st.begin());
    ans += value.first;
    if (ans > INF) return INF;
  }
  return ans;
}
int main() {
  n = nextInt();
  m = nextInt();
  s = nextInt();
  for (int i = 0; i < (int)(m); i++) {
    b[i].diff = nextInt();
    b[i].id = i;
  }
  sort(b, b + m);
  for (int i = 0; i < (int)(n); i++) a[i].exp = nextInt();
  for (int i = 0; i < (int)(n); i++) a[i].cost = nextInt();
  for (int i = 0; i < (int)(n); i++) a[i].id = i;
  sort(a, a + n);
  int l = 1, r = m;
  while (r - l > 1) {
    int mid = (l + r) >> 1;
    if (solve(mid) <= s)
      r = mid;
    else
      l = mid;
  }
  int ans = n;
  for (int mid = l; mid <= r; mid++)
    if (solve(mid) <= s) {
      ans = mid;
      break;
    }
  if (solve(ans) > s) {
    cout << "NO" << endl;
    return 0;
  }
  cerr << ans << endl;
  cout << "YES" << endl;
  vector<int> res(m, -1);
  for (int i = 0; i < (int)(m); i++) res[b[i].id] = rr[i / ans];
  for (int i = 0; i < (int)(m); i++) cout << res[i] + 1 << " ";
  return 0;
}
