#coding=UTF-8 #できれば気分転換する N=int(input()) eph=[] for idx in range(0,N,1): mojir=input() hyo=mojir.split() G=int(hyo[0]) D=int(hyo[1]) eph.append((G-30000*D,idx)) ritu=sorted(eph,reverse=True) #print(ritu) dame=True for idx in range(len(ritu),0,-1): wa=0 for idy in range(0,6,1): wa=wa+ritu[idy%idx][0] if wa>= 30000*100: print("YES") for idy in range(0,6,1): print(ritu[idy%idx][1]+1) dame=False break if dame: print("NO")