#include using namespace std; int p[32], sum[32] = {}; int n, s; void dfs(int i, int a, string str){ if(a == s){ cout << str.substr(1) << endl; return; } if(i == n || a + sum[i] < s) return; if(a + p[i] <= s) dfs(i+1, a+p[i], str + " " + to_string(i+1)); if(a + sum[i+1] >= s) dfs(i+1, a, str); } int main(){ cin >> n >> s; for(int i = 0; i < n; i++) cin >> p[i]; for(int i = 30; i >= 0; i--) sum[i] += sum[i+1] + p[i]; dfs(0, 0, ""); return 0; }