#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 1;
int n, target, a[N], sum ;
vector<int>ans ;
void solve(int idx)
{
if(sum > target)
return ;
if(idx == n + 1)
{
if(sum == target)
{
for(auto & x : ans)
cout<<x<<' ' ;
cout<<'\n' ;
}
return ;
}
/// pick
sum += a[idx] ;
ans.push_back(a[idx]) ;
solve(idx + 1) ;
sum -= a[idx] ;
ans.pop_back() ;
/// leave
solve(idx + 1) ;
}
int main() {
cin>>n>>target ;
for(int i = 1 ; i <= n ; i++)
cin>>a[i] ;
solve(1) ;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBOID0gMWUyICsgMTsKaW50IG4sIHRhcmdldCwgYVtOXSwgc3VtIDsKdmVjdG9yPGludD5hbnMgOwp2b2lkIHNvbHZlKGludCBpZHgpCnsKICAgIGlmKHN1bSA+IHRhcmdldCkKICAgICAgICByZXR1cm4gOwogICAgaWYoaWR4ID09IG4gKyAxKQogICAgewogICAgICAgIGlmKHN1bSA9PSB0YXJnZXQpCiAgICAgICAgewogICAgICAgICAgICBmb3IoYXV0byAmIHggOiBhbnMpCiAgICAgICAgICAgICAgICBjb3V0PDx4PDwnICcgOwogICAgICAgICAgICBjb3V0PDwnXG4nIDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDsKICAgIH0KICAgIC8vLyBwaWNrCiAgICBzdW0gKz0gYVtpZHhdIDsKICAgIGFucy5wdXNoX2JhY2soYVtpZHhdKSA7CiAgICBzb2x2ZShpZHggKyAxKSA7CiAgICBzdW0gLT0gYVtpZHhdIDsKICAgIGFucy5wb3BfYmFjaygpIDsKICAgIC8vLyBsZWF2ZQogICAgc29sdmUoaWR4ICsgMSkgOwp9CmludCBtYWluKCkgewogICAgY2luPj5uPj50YXJnZXQgOwogICAgZm9yKGludCBpID0gMSA7IGkgPD0gbiA7IGkrKykKICAgICAgICBjaW4+PmFbaV0gOwogICAgc29sdmUoMSkgOwogICAgcmV0dXJuIDA7Cn0K