#include using namespace std; #define inf INT_MAX #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define M (int)(1e9+7) #define P pair #define PLL pair #define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++) #define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--) #define rep(i,n) FOR(i,0,n) #define rrep(i,n) RFOR(i,n,0) #define all(a) a.begin(),a.end() #define IN(a,n) rep(i,n){ cin>>a[i]; } const int vx[4] = {0,1,0,-1}; const int vy[4] = {1,0,-1,0}; #define PI 3.14159265 #define F first #define S second #define PB push_back #define EB emplace_back #define int ll #define vi vector int n,s; vector p; vector vec[2]; void dfs(int t,vi v,int l,int m){ if(l==m){ vec[m/n].PB(v); return; } dfs(t,v,l+1,m); v.PB(l+1); dfs(t+p[l],v,l+1,m); } signed main(){ cin.tie(0); ios::sync_with_stdio(false); cin>>n>>s; p=vi(n); rep(i,n){ cin>>p[i]; } dfs(0,vi(),0,n/2+1); dfs(0,vi(),n/2+1,n); sort(all(vec[0])); sort(all(vec[1])); vector ans; for(vi v1:vec[0]){ int s1=0; for(int i:v1){ s1+=p[i-1]; } for(vi v2:vec[1]){ int s2=0; for(int i:v2){ s2+=p[i-1]; } if(s1+s2==s){ vi v; for(int i:v1) v.PB(i); for(int i:v2) v.PB(i); ans.PB(v); } } } sort(all(ans)); for(vi v:ans){ for(int i:v){ cout<