N,M = map(int,input().split()) A = list(map(int,input().split())) P = list(map(int,input().split())) dp = [[0] * (M + 1) for _ in range(N+1)] dp[N-1][0] = 1 dp[N-1][A[-1]] = 1 dp[-1][0] = 1 for i in reversed(range(N-1)): for j in range(M+1): dp[i][j] = dp[i+1][j] for j in range(M+1): if j + A[i] <= M: if dp[i+1][j]: dp[i][j+A[i]] = 1 else: break import sys if dp[0][-1] == 0: print(-1) exit() ans = [] now = M left = -1 while now: _min = 10000 index = -1 for i in range(left+1,N): if A[i] <= now and dp[i+1][now-A[i]]: if P[i] < _min: _min = P[i] index = i ans.append(index+1) now -= A[index] left = index print(len(ans)) print(*ans)