#include <bits/stdc++.h>   using namespace std;   const long long INF = (long long)1e12;   const int maxn = 100050;   struct STU {     int b, c, id;     bool operator<(const STU &s) const {       return c < s.c || (c == s.c && id < s.id);     }   };   map<STU, int> mp;   bool cmp(const STU &a, const STU &b) { return a.b < b.b; }   struct BUG {     int a, id;     bool operator<(const BUG &s) const { return a < s.a; }   };   STU stu[maxn];   BUG bug[maxn];   int N, M, S;   int ans[maxn];   bool judge(int times) {     mp.clear();     long long pass = 0;     int p = M - 1, q = N - 1;     map<STU, int>::iterator it;     for (; p >= 0; p--) {       while (q >= 0 && stu[q].b >= bug[p].a) {         mp[stu[q]] = times;         q--;       }       if (p == M - 1 || it->second <= 0) {         if (p != M - 1) mp.erase(it);         it = mp.begin();         if (it == mp.end()) return false;         pass += it->first.c;       }       ans[bug[p].id] = it->first.id;       it->second--;     }     return pass <= S;   }   int main() {     scanf( %d%d%d , &N, &M, &S);     int max_a = 0;     for (int i = 0; i < M; i++)       scanf( %d , &bug[i].a), bug[i].id = i + 1, max_a = max(max_a, bug[i].a);     for (int i = 0; i < N; i++) scanf( %d , &stu[i].b);     for (int i = 0; i < N; i++) scanf( %d , &stu[i].c), stu[i].id = i + 1;     bool ok = false;     for (int i = 0; i < N; i++)       if (stu[i].b >= max_a && stu[i].c <= S) ok = true;     if (!ok) {       printf( NO n );       return 0;     } else       printf( YES n );     sort(bug, bug + M);     sort(stu, stu + N, cmp);     int L = 1, H = M, mid;     while (L < H) {       mid = L + (H - L) / 2;       if (judge(mid))         H = mid;       else         L = mid + 1;     }     judge(L);     for (int i = 1; i < M; i++) printf( %d  , ans[i]);     printf( %d n , ans[M]);     return 0;   }   