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[-1][0] = 1 for i in range(n, 0, -1): for j in range(m + 1): if j + a[i - 1] <= m: dp[i - 1][j + a[i - 1]] |= dp[i][j] dp[i - 1][j] |= dp[i][j] if not dp[0][m]: print(-1) exit(0) idx = -1 ans = [] while m > 0: mi = -1 for i in range(idx + 1, n): if m >= a[i] and dp[i + 1][m - a[i]] and (mi == -1 or p[i] < p[mi]): mi = i m -= a[mi] idx = mi ans.append(idx + 1) print(len(ans)) print(*ans)