n = input() ls = [] for i in xrange(n): g, d = map(int, raw_input().split()) ls.append([g - 30000 * d, i]) ls.sort(reverse=True) if ls[0][0] * 6 >= 30000 * 100: print "YES" for i in xrange(6): print ls[0][1] else: print "NO"