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[0][0] = 1 for i, a in enumerate(A, 1): for j in range(M+1): dp[i][j] |= dp[i-1][j] # 使わない for j in range(a, M+1): dp[i][j] |= dp[i-1][j-a] if dp[N][M] == 0: print(-1) exit() # print(*dp, sep="\n") # print() dp[N][M] = 2 for i in reversed(range(N)): for j in range(M+1): if dp[i+1][j] == 2 and dp[i][j]: dp[i][j] = 2 for j in range(A[i], M+1): if dp[i+1][j] == 2 and dp[i][j-A[i]]: dp[i][j-A[i]] = 2 ans = [] total = 0 now = 0 while True: pmin = 100000000 tmp = -1 for i in range(now, N): if dp[i][total] == 2: if total + A[i] > M: continue if dp[i+1][total + A[i]] == 2: if P[i] < pmin: pmin = P[i] tmp = i total += A[tmp] now = tmp ans.append(now+1) if total >= M: break print(len(ans)) print(*ans)