def dfs(index, money, goods): if money == S: print ' '.join(goods) return if index == N or money > S or money + accumulation[index] < S: return goods.append(str(index + 1)) dfs(index + 1, money + P[index], goods) goods.pop() dfs(index + 1, money, goods) N, S = map(int, raw_input().split()) P = [input() for i in xrange(N)] accumulation = [0] * N accumulation[N - 1] = P[N - 1] for i in xrange(N - 2, -1, -1): accumulation[i] = accumulation[i + 1] + P[i] dfs(0, 0, [])