n=int(input()) d=[(x-int(y*3e4)) for x,y in [map(int,input().split()) for i in'.'*n]] print('YNEOS'[max(d)*6<3e6::2]) for i in'.'*6:print(d.index(max(d))+1)