#include <bits/stdc++.h>
using namespace std;
template <class T>
using v2d = vector<vector<T> >;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
const int maxN = 1e5 + 1;
const int maxM = 1e5 + 1;
int n, m;
long long s;
int fs = 1e9;
struct bug {
  int a;
  int idx;
  int rs;
} bg[maxM];
int flag[maxM];
struct stu {
  int b;
  long long c;
  int idx;
} st[maxN];
auto cmp = [](stu x, stu y) { return x.c > y.c; };
bool Try(int k) {
  memset(flag, 0, sizeof(flag));
  priority_queue<stu, vector<stu>, decltype(cmp)> pq(cmp);
  int idx = n;
  long long sum = 0;
  for (int i = 1; i <= (int)(m); ++i) {
    if (flag[i]) {
      continue;
    }
    while (idx > 0 && st[idx].b >= bg[i].a) {
      pq.push(st[idx]);
      --idx;
    }
    if (pq.empty()) {
      return 0;
    }
    bool fd = 0;
    if (sum + pq.top().c > s) {
      continue;
    }
    sum += pq.top().c;
    for (int j = i; j <= min(i + k - 1, m); ++j) {
      flag[j] = 1;
      bg[j].rs = pq.top().idx;
      fd = 1;
    }
    if (fd) {
      pq.pop();
    }
  }
  for (int i = 1; i <= (int)(m); ++i) {
    if (!flag[i]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m >> s;
  for (int i = 1; i <= (int)(m); ++i) {
    cin >> bg[i].a;
    bg[i].idx = i;
  }
  sort(bg + 1, bg + m + 1, [](bug x, bug y) { return x.a > y.a; });
  for (int i = 1; i <= (int)(n); ++i) {
    cin >> st[i].b;
    st[i].idx = i;
  }
  for (int i = 1; i <= (int)(n); ++i) {
    cin >> st[i].c;
  }
  sort(st + 1, st + n + 1, [](stu x, stu y) { return x.b < y.b; });
  int l = 1, r = 1e9;
  int mid = (l + r) / 2;
  while (l != mid && r != mid) {
    if (Try(mid)) {
      r = mid;
      uin(fs, mid);
    } else {
      l = mid;
    }
    mid = (l + r) / 2;
  }
  for (mid = l; mid <= r; ++mid) {
    if (Try(mid)) {
      uin(fs, mid);
      break;
    }
  }
  if (fs == 1e9) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  sort(bg + 1, bg + m + 1, [](bug x, bug y) { return x.idx < y.idx; });
  for (int i = 1; i <= (int)(m); ++i) {
    cout << bg[i].rs << ' ';
  }
  return 0;
}
