n = int(input()) g_list = [] d_list = [] ex_list = [] for i in range(n): gi, di = [int(i) for i in input().split()] g_list.append(gi) d_list.append(di) ex_list.append(gi - 30000 * di) res = None if max(ex_list) * 6 >= 30000 * 100: res = ex_list.index(max(ex_list)) + 1 print('YES') for i in range(6): print(res) else: res = 'NO' print(res)