#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int main(){ int n,s,p[31]; map > mp; map >::iterator it; cin>>n>>s; rep(i,n)cin>>p[i]; rep(i,1<>j&1)sum+=p[(n+1)/2+j]; mp[sum].push_back(i); } vector > ans; rep(i,1<<(n+1)/2){ int sum=0; rep(j,(n+1)/2)if(i>>j&1)sum+=p[j]; it=mp.find(s-sum); if(it!=mp.end()){ vector &v=it->second; rep(j,v.size()){ int bit=i|v[j]<<(n+1)/2; bool f=true; ans.push_back(vector()); rep(k,n){ if(bit>>k&1)ans.back().push_back(k+1); } } } } sort(all(ans)); rep(i,ans.size()){ bool f=true; rep(j,ans[i].size()){ if(!f)cout<<' '; f=false; cout<