n, s = map(int, input().split()) prices = [int(input()) for _ in range(n)] first = prices[:n // 2] second = prices[n // 2:] F = {} S = {} len_f = len(first) for l in range(1 << len_f): t = [] sum = 0 for i in range(len_f): if l >> i & 1: t.append(i + 1) sum += first[i] if sum not in F: F[sum] = [] F[sum].append(t[:]) len_s = len(second) for l in range(1 << len_s): t = [] sum = 0 for i in range(len_s): if l >> i & 1: t.append(i + len_f + 1) sum += second[i] if sum not in S: S[sum] = [] S[sum].append(t[:]) ans = [] for p in F: if s - p in S: for p1 in F[p]: for p2 in S[s - p]: ans.append(p1 + p2) ans.sort() for a in ans: print(" ".join(map(str, a)))