#include <bits/stdc++.h>
using namespace std;
struct node2 {
  int id, cost;
} temp2;
vector<node2> pp;
struct node1 {
  int pos, abl, pass;
} temp1;
vector<node1> vv, ee;
bool compare1(node2 aa, node2 bb) { return aa.cost > bb.cost; }
bool compare2(node1 aa, node1 bb) { return aa.abl > bb.abl; }
class Q_comp {
 public:
  bool operator()(const node1 &aa, const node1 &bb) {
    return aa.pass > bb.pass;
  }
};
int ans[100010];
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, i, j, s, temp_s;
  cin >> n >> m >> s;
  for (i = 0; i < m; i++) {
    temp2.id = i;
    cin >> temp2.cost;
    pp.push_back(temp2);
  }
  for (i = 0; i < n; i++) {
    temp1.pos = i;
    cin >> temp1.abl;
    vv.push_back(temp1);
  }
  for (i = 0; i < n; i++) {
    cin >> vv[i].pass;
  }
  sort(pp.begin(), pp.end(), compare1);
  sort(vv.begin(), vv.end(), compare2);
  int left = 1, right = m, day = 0, mid;
  while (left <= right) {
    mid = (left + right) >> 1;
    priority_queue<node1, vector<node1>, Q_comp> Q;
    temp_s = s;
    bool found = false;
    i = j = 0;
    for (; i < m; i += mid) {
      int difi = pp[i].cost;
      if (j < n)
        while (difi <= vv[j].abl) {
          Q.push(vv[j]);
          j++;
          if (j == n) break;
        }
      if (!Q.empty()) {
        temp1 = Q.top();
        Q.pop();
        if (temp_s >= temp1.pass)
          temp_s -= temp1.pass;
        else {
          goto bad_pos;
        }
      } else {
        goto bad_pos;
      }
    }
    found = true;
    day = mid;
  bad_pos:;
    if (found)
      right = mid - 1;
    else
      left = mid + 1;
  }
  if (day == 0) {
    cout << "NO" << endl;
    return 0;
  }
  priority_queue<node1, vector<node1>, Q_comp> QQ;
  j = 0;
  for (i = 0; i < m; i += day) {
    int dd = pp[i].cost;
    if (j < n)
      while (vv[j].abl >= dd) {
        QQ.push(vv[j]);
        j++;
        if (j == n) break;
      }
    node1 tem = QQ.top();
    QQ.pop();
    ee.push_back(tem);
  }
  for (i = 0; i < ee.size(); i++) {
    for (j = 0; j < day && day * i + j < m; j++) {
      ans[pp[day * i + j].id] = ee[i].pos + 1;
    }
  }
  cout << "YES" << endl;
  for (i = 0; i < m; i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
