#include int main(void){ int N; int EXP = 0; int G,D; int eph = 0; // EXP per hour int F = 1; scanf("%d",&N); for(int i = 0; i < N; i++){ scanf("%d %d",&G,&D); if(eph < G - 3000*D){ eph = G - 3000*D; F = i+1; } } if(eph * 6 >= 3000000){ printf("YES\n"); for(int j = 0; j < 6; j++){ printf("%d\n",F); } }else{ printf("NO\n"); } return 0; }