#include <bits/stdc++.h>
using namespace std;
long long P = 1e9 + 7;
long long P1 = 998244353;
const int sqr = 500;
const int arrn = 1e6 + 5;
const int arrn2 = 6e3 + 5;
int n, m;
long long s;
vector<pair<long long, int>> a;
vector<pair<pair<long long, long long>, int>> b;
bool chk(int d) {
  if (d == 0) return m == 0;
  priority_queue<long long> tem;
  int ind = n - 1;
  long long tot = 0;
  for (int i = m - 1; i >= 0; i -= d) {
    while (ind >= 0 && b[ind].first.first >= a[i].first) {
      tem.push(-b[ind].first.second);
      ind--;
    }
    if (tem.empty()) return false;
    tot += (-tem.top());
    tem.pop();
  }
  return (tot <= s);
}
void solve() {
  cin >> n >> m >> s;
  a.resize(m);
  b.resize(n);
  for (int i = 0; i < m; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 0; i < n; i++) cin >> b[i].first.first;
  for (int i = 0; i < n; i++) cin >> b[i].first.second;
  for (int i = 0; i < n; i++) b[i].second = i;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long l = 0, r = m;
  if (!chk(m)) {
    cout << "NO";
    return;
  }
  while (r - l > 1) {
    long long mid = (l + r) >> 1;
    if (chk(mid))
      r = mid;
    else
      l = mid;
  }
  vector<int> ans(m, 0);
  priority_queue<pair<long long, long long>> tem;
  int ind = n - 1;
  for (int i = m - 1; i >= 0; i -= r) {
    while (ind >= 0 && b[ind].first.first >= a[i].first) {
      tem.push({-b[ind].first.second, b[ind].second});
      ind--;
    }
    for (int j = i; j > max(-1ll, i - r); j--) {
      ans[a[j].second] = tem.top().second;
    }
    tem.pop();
  }
  cout << "YES\n";
  for (auto i : ans) cout << i + 1 << ' ';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
