#include <bits/stdc++.h>
using namespace std;
const long long int Maxn3 = 1e3 + 10;
const long long int Maxn4 = 1e4 + 10;
const long long int Maxn5 = 1e5 + 10;
const long long int Maxn6 = 1e6 + 10;
const long long int Maxn7 = 1e7 + 10;
const long long int Maxn8 = 1e8 + 10;
const long long int Maxn9 = 1e9 + 10;
const long long int Maxn18 = 1e18 + 10;
const long long int Mod1 = 1e7 + 7;
const long long int Mod2 = 1e9 + 7;
const long long int LLMax = LLONG_MAX;
const long long int LLMin = LLONG_MIN;
const long long int INTMax = INT_MAX;
const long long int INTMin = INT_MIN;
long long int mn = LLMax, mx = LLMin;
vector<pair<long long int, long long int> > bugs;
vector<pair<long long int, pair<long long int, long long int> > > students;
long long int ab[100010], res[100010], te[100005];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int n, m, s, taken = 0;
  cin >> n >> m >> s;
  for (long long int i = 0; i < m; i++) {
    long long int d;
    cin >> d;
    bugs.push_back(make_pair(d, i));
  }
  for (long long int i = 0; i < n; i++) cin >> ab[i];
  for (long long int i = 0; i < n; i++) {
    long long int d;
    cin >> d;
    students.push_back(make_pair(ab[i], make_pair(d, i)));
  }
  sort(bugs.begin(), bugs.end());
  reverse(bugs.begin(), bugs.end());
  sort(students.begin(), students.end());
  reverse(students.begin(), students.end());
  long long int l = 1, r = m;
  while (r >= l) {
    set<pair<long long int, pair<long long int, long long int> > > temp;
    set<pair<long long int, pair<long long int, long long int> > >::iterator it;
    long long int mid = (l + r) / 2, ptr = 0, index = 0, need = 0, a = 0, b = 0,
                  c = 0, t = 0, flag = 0, x, y, z, j;
    if (mid * n >= m) {
      for (long long int i = 0; i < m;) {
        y = mid, need = bugs[i].first, index = bugs[i].second;
        for (j = ptr; j < n; j++) {
          if (students[j].first >= need) {
            a = students[j].second.first;
            b = students[j].first;
            c = students[j].second.second;
            temp.insert(make_pair(a, make_pair(b, c)));
          } else
            break;
        }
        ptr = j;
        if (temp.size() == 0) break;
        it = temp.begin();
        a = it->first;
        b = it->second.first;
        c = it->second.second;
        temp.erase(it);
        t += a;
        while (i < m && y--) {
          te[bugs[i].second] = c + 1;
          i++;
          if (i == m) flag = 1;
        }
      }
    }
    if (t <= s and flag == 1) {
      r = mid - 1;
      taken = 1;
      for (long long int i = 0; i < m; i++) res[i] = te[i];
    } else
      l = mid + 1;
  }
  if (taken == 1) {
    cout << "YES\n";
    for (long long int i = 0; i < m; i++) cout << res[i] << " ";
  } else
    cout << "NO";
  return 0;
}
