import itertools as it v = 30000 * 100 N = int(raw_input()) exprate = {} for i in range(1, N + 1): g, d = map(int, raw_input().split()) exprate[i] = g - 30000 * d maxexp = max(exprate.values()) rt = [] if maxexp * 6 < v: print 'NO' else: print 'YES' for i in range(1, min(6, N) + 1): if exprate[i] >= v / 6: rt.append(i) for i in range(6): print rt[(i % len(rt))]