n = int(input()) D = [map(int, input().split()) for i in range(n)] d = [g - 30000 * d for g, d in D] v = max(d) if v * 6 >= 3000 * 100: print("YES") for _ in range(6): print(d.index(max(d))+1) else: print("NO")