#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int main(){ int N; ll SS; cin >> N >> SS; vector P(N); rep(i,N){ cin >> P[i]; } vector P1, P2; rep(i,N/2){ P1.push_back(P[i]); } REP(i,N/2,N){ P2.push_back(P[i]); } map > memo1, memo2; for(ll S=0; S<(1<>i)&1) sum += P1[i]; } memo1[sum].push_back(S); } for(ll S=0; S<(1<>i)&1) sum += P2[i]; } memo2[sum].push_back(S); } map,int> ret; FOR(it,memo1){ if(memo2.count(SS - (it->first)) > 0){ vector res1 = it->second; vector res2 = memo2[SS - (it->first)]; rep(i,res1.size()){ rep(j,res2.size()){ ll S = res1[i] | (res2[j]< res; rep(i,40){ if((S>>i)&1) res.push_back(i+1); } ret[res] = 1; } } } } FOR(it,ret){ rep(i,(it->first).size()){ if(i>0) cout << " "; cout << (it->first)[i]; } cout << endl; } return 0; }