import java.util.Random; import java.util.Scanner; public class Yukicoder231 { public static final int EXP = 3000000; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] gain = new int[N]; int maxIndex = 0; int max = 0; for (int i = 0; i < N; i++) { int G = scanner.nextInt(); int D = scanner.nextInt(); gain[i] = G - EXP / 100 * D; if (max < gain[i]) { max = gain[i]; maxIndex = i; } } if (EXP > gain[maxIndex] * 6) { System.out.println("NO"); } else { System.out.println("YES"); int[] choice = new int[6]; while (true) { int sum = 0; Random random = new Random(); for (int i = 0; i < 6; i++) { choice[i] = random.nextInt(gain.length); sum += gain[choice[i]]; } if (sum >= EXP) { break; } } for (int i = 0; i < 6; i++) { System.out.println(choice[i]); } } } }