n = int(input()) max_e = 0 candidates = [] for i in range(1, n + 1): g, d = map(int, input().split()) e = g - 30000 * d if e > max_e: max_e = e candidates = [i] elif e == max_e: candidates.append(i) required = 30000 * 100 # 3,000,000 if max_e * 6 < required: print("NO") else: print("YES") for h in range(6): idx = h % len(candidates) print(candidates[idx])