import itertools as it v = 30000 * 100 N = int(raw_input()) exprate = {} for i in range(1, N + 1): g, d = map(int, raw_input().split()) exprate[i] = g - 30000 * d maxexp = max(exprate.values()) if maxexp * 6 < v: print 'NO' else: print 'YES' for i in range(1, 7): exprate[i] = maxexp for j in range(1, 7): print i