from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline N,S = map(int,input().split()) P = [int(input()) for i in range(N)] if N==1: print(1) exit() n = N//2 m = N-n P0 = P[:n] P1 = P[n:] S0 = defaultdict(lambda:[]) S1 = defaultdict(lambda:[]) Z0 = [] Z1 = [] def cle(a,D): y = len(D)-1 x = 0 if D[x]>a: return 0 if D[y]<=a: return y+1 while y-x>1: mid = (y+x)//2 if D[mid]<=a: x = mid else: y = mid return y for i in range(1<>j)&1: tmp += P0[j] Z0.append(int(tmp)) S0[tmp].append(i) for i in range(1<>j)&1: tmp += P1[j] Z1.append(int(tmp)) S1[tmp].append(i) Z0 = list(set(Z0)) Z1 = list(set(Z1)) Z0.sort() Z1.sort() ans = [] for z0 in Z0: t = cle(S-z0,Z1) if t==0: continue for tx in S0[z0]: for ty in S1[S-z0]: ans.append(tx + (ty<>i)&1: tmp.append(i+1) Z.append(tuple(tmp)) Z.sort() for z in Z: print(*z)