N, X = (int(x) for x in input().split()) V = [int(x) for x in input().split()] W = [int(x) for x in input().split()] dp = [[(-1, -1, -1)] * (X + 1)] dp[0][0] = (0, -1, -1) for i in range(N - 1, -1, -1): ndp = dp[-1][:] for w in range(X - W[i], -1, -1): if dp[-1][w][0] == -1: continue if ( ndp[w + W[i]][0] == -1 or dp[-1][w][0] + V[i] > ndp[w + W[i]][0] ): ndp[w + W[i]] = (dp[-1][w][0] + V[i], i, dp[-1][w][1]) dp.append(ndp) result = [] for w in range(X, -1, -1): if dp[-1][w][0] == -1: continue target = dp[-1][w][1] while target != -1: if dp[-1][w][1] == target: result.append(target + 1) target = dp[-1][w][2] w -= W[dp[-1][w][1]] dp.pop() break print(len(result)) print(*result)