n,m = map(int,input().split()) a = list(map(int,input().split())) from collections import defaultdict d_minus,d_plus = defaultdict(int),defaultdict(int) if a[0] >= 0:turn = -1 else:turn = 1 idx = 0 lan = [] for i in range(n): if turn * a[i] >= 0: lan[len(lan)-1][0] += a[i] else: turn *= -1 # if turn == 1: # d_plus[] # else: if len(lan) != 0: lan[len(lan)-1].append(i) lan.append([a[i],i]) lan[-1].append(n) lan.sort(key = lambda x:x[0]) ans = [] for val,l,r in lan: if val < 0: m -= 2 ans.append(l) ans.append(r) if r == n: m += 1 if m >=0: for i in range(m): ans.append(n) for idx in ans: print(idx) else: not_ans = set() for val,l,r in lan: if val >= 0: if r != n : not_ans.add(r) m += 1 if l == 0: continue not_ans.add(l) m += 1 if m >= 0: break if m == 1: ans.append(n) for idx in ans: if not idx in not_ans: print(idx)