import sys while True: try: n,k = map(int,input().split()) lst = [] for i in range(1,n+1): x,y =map(int,input().split()) z = x + 2*y lst.append([i,x,y,z]) lst.sort(key= lambda x : (-x[3],-x[2])) ans = [x[0] for x in lst[:k]] for i in sorted(ans): print(i,end=' ') except: break