#include <bits/stdc++.h> 
using namespace std;
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef long double ld;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef map<int, int> mii;
typedef unordered_map<int, int> umii;
const ll mod = 1e9 + 7;
const int inf = INTMAX_MAX;
const bool tc = false;
const int mxn = 1e6 + 5;
int d[mxn]; ll p[mxn]; int v[mxn]; ll vp[mxn];
pll bounds[mxn]; int nxtsg[mxn]; int up[mxn][26]; ll sex[mxn]; ll sroot[mxn]; vi adj[mxn];
ll sv(int l, int r) {
    return (ll)((ll)vp[r + 1] - (ll)vp[l]);
}
void dfs(int node, int prev) {
    sroot[node] = (ll)((ll)sroot[prev] + (ll)sex[node]);
    for (auto &neighbour : adj[node]) {
        if (neighbour == prev) continue;
        dfs(neighbour, node);
    }
}
ll kanc(int node, int k) {
    for (int i = 0; i < 26; i++) {
        if (k & (1 << i)) node = up[node][i];
    }
    return node;
}
inline void solve() {
    // input
    ll n, s, k;
    cin >> n >> s >> k;
    for (int i = 0; i < n - 1; i++) cin >> d[i];
    for (int i = 1; i < n; i++) p[i] = (ll)((ll)p[i - 1] + (ll)d[i - 1]);
    for (int i = 0; i < n; i++) cin >> v[i];
    for (int i = 1; i <= n; i++) vp[i] = (ll)((ll)vp[i - 1] + (ll)v[i - 1]);
    
    // calculate bounds
    for (int t = 0; t < n; t++) {
        int lo = t;
        int hi = n;
        while (hi > lo + 1) {
            int mid = (lo + hi) / 2;
            if ((ll)((ll)p[mid] - (ll)p[t]) > (ll)k) hi = mid;
            else lo = mid;
        }
        int r = lo;
        int l;
        if ((ll)p[t] <= k) l = 0;
        else {
            int lo = 0;
            int hi = t;
            while (hi > lo + 1) {
                int mid = (lo + hi) / 2;
                if ((ll)((ll)p[t] - (ll)p[t-mid]) > k) hi = mid;
                else lo = mid;
            }
            l = t-lo;
        }
        bounds[t] = {l, r};
        //cout << t << " bounds " << l << " -> " << r << '\n';
    }
    bounds[n] = {1e8, 1e8};
    // find next segment
    for (int st = 0; st < n; st++) {
        int nxt;
        if (bounds[st].se != n - 1 && bounds[st + 1].fi <= bounds[st].se + 1) {
            int lo = st;
            int hi = n;
            while (hi > lo + 1) {
                int mid = (lo + hi) / 2;
                if (bounds[mid].fi <= bounds[st].se + 1) lo = mid;
                else hi = mid;
            }
            nxt = lo;
        } else {
            nxt = n;
        }
        nxtsg[st] = nxt;
        sex[st] = sv(bounds[st].fi, bounds[st].se);
        if (bounds[nxt].fi <= bounds[st].se) sex[st] -= sv(bounds[st].se, bounds[nxt].fi);
    }
    for (int i = 0; i < n; i++) {
        adj[nxtsg[i]].pb(i);
        adj[i].pb(nxtsg[i]);
    }
    dfs(n, n);
    for (int i = 0; i < 26; i++) {
        up[n][i] = n;
    }    
    for (int i = 0; i < n; i++) {
        up[i][0] = nxtsg[i];
    }
    for (int l = 1; l < 26; l++) {
        for (int i = 0; i < n; i++) {
            up[i][l] = up[up[i][l - 1]][l - 1];
        }
    }
    pair<ll, int> ans = {-100, -1};
    for (int i = 0; i < n; i++) {
        int high = kanc(i, s - 1);
        if (high == n) {
            ans = max(ans, {(ll)sroot[i] - (ll)sex[n - 1] + (ll)sv(bounds[n - 1].fi, bounds[n - 1].se), i});
        } else {
            ans = max(ans, {(ll)sroot[i] - (ll)sroot[up[high][0]] - (ll)sex[high] + (ll)sv(bounds[high].fi, bounds[high].se), i});
        }
    }
    
    vi answer; int cur = ans.se; for (int i = 0; i < s; i++) {
        if (cur == n) break;
        answer.pb(cur);
        cur = up[cur][0];
    }
    cout << answer.size() << '\n';
    for (auto &x : answer) cout << x + 1 << " ";
    cout << '\n';
}
void setIO(string s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}
signed main() {
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    //setIO();
    int t = 1;
    if (tc) {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}
Compilation message (stderr)
SolarStorm.cpp:29:17: warning: overflow in conversion from 'long int' to 'int' changes value from '9223372036854775807' to '-1' [-Woverflow]
   29 | const int inf = INTMAX_MAX;
      |                 ^~~~~~~~~~
SolarStorm.cpp: In function 'void setIO(std::string)':
SolarStorm.cpp:157:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  157 |     freopen((s + ".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SolarStorm.cpp:158:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  158 |     freopen((s + ".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |