#include "bits/stdc++.h" using namespace std; void output(vector v){ for (int i = 0; i < v.size(); i++) { if (i != v.size() - 1) cout << v[i] << " "; else cout << v[i] << endl; } } int main() { int N; long long S; cin >> N >> S; vector P(N); for (int i = 0; i < N; i++) { cin >> P[i]; } if (N == 1){ if (P[0] == S){ cout << 1 << endl; } return 0; } int a = N / 2; int b = N - a; map> m; for (int i = 0; i < (1<> j) % 2 == 0) continue; sum += P[j]; } m[sum].push_back(i); } vector> answers; for (int i = 0; i < (1 << b); i++) { long long sum = 0; for (int j = 0; j < b; j++) { if ((i >> j) % 2 == 0) continue; sum += P[a + j]; } long long need = S - sum; for (auto ar : m[need]){ vector ans; for (int j = 0; j < a; j++) { if ((ar >> j) % 2 == 1) ans.push_back(j + 1); } for (int j = 0; j < b; j++) { if ((i >> j) % 2 == 1) ans.push_back(a + j + 1); } answers.push_back(ans); } } sort(answers.begin(), answers.end()); for (auto ans: answers) { output(ans); } }