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