import sys input = sys.stdin.readline from collections import * N, S = map(int, input().split()) P = [int(input()) for _ in range(N)] N1 = N//2 d1 = defaultdict(list) for S1 in range(1<>i)&1: s += P[i] d1[s].append(S1) N2 = N-N//2 d2 = defaultdict(list) for S2 in range(1<>i)&1: s += P[N1+i] d2[s].append(S2) ans = [] for k in d1: for S1 in d1[k]: for S2 in d2[S-k]: l = [] for i in range(N1): if (S1>>i)&1: l.append(i+1) for i in range(N2): if (S2>>i)&1: l.append(N1+i+1) ans.append(l) ans.sort() for l in ans: print(*l)