#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline string tostr(const T &x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
const long double EPS = 1e-14;
const int INF = 1000 * 1000 * 1000;
const char CINF = 102;
const long long LINF = INF * 1ll * INF;
const long double DINF = 1e200;
const long double PI = 3.1415926535897932384626433832795L;
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
int ans[110000];
long long check(const vector<pair<long long, long long> > &A,
                const vector<pair<pair<long long, long long>, int> > &B,
                int k) {
  long long res = 0;
  int p = ((int)(B).size()) - 1;
  set<pair<long long, int> > s;
  for (int i = ((int)(A).size()) - 1; i >= 0;) {
    while (p >= 0 && B[p].first.first >= A[i].first) {
      s.insert(make_pair(B[p].first.second, B[p].second));
      --p;
    }
    if (s.empty()) return LINF;
    res += s.begin()->first;
    for (int q = 0; q < (k); ++q) {
      if (i < 0) break;
      ans[A[i].second] = s.begin()->second;
      --i;
    }
    s.erase(s.begin());
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  long long s;
  cin >> n >> m >> s;
  vector<pair<long long, long long> > A(m);
  vector<pair<pair<long long, long long>, int> > B(n);
  for (int i = 0; i < (((int)(A).size())); ++i) {
    cin >> A[i].first;
    A[i].second = i;
  }
  for (int i = 0; i < (((int)(B).size())); ++i) {
    cin >> B[i].first.first;
  }
  for (int i = 0; i < (((int)(B).size())); ++i) {
    cin >> B[i].first.second;
    B[i].second = i;
  }
  sort((A).begin(), (A).end());
  sort((B).begin(), (B).end());
  int a = 0, b = m + 1;
  while (b > a + 1) {
    int k = (a + b) / 2;
    if (check(A, B, k) > s)
      a = k;
    else
      b = k;
  }
  if (b == m + 1)
    cout << "NO";
  else {
    check(A, B, b);
    cout << "YES\n";
    for (int i = 0; i < (m); ++i) {
      cout << ans[i] + 1 << ' ';
    }
  }
  return 0;
}
