N=int(input()) i=0 A=[] for i in range(N): A.append(input().split()) i+=1 y=0 i=0 K=[0,1,2,3,4,5,6,7,8,9] while y==0: if A[i][4]=="YES": K=A[i][:-1] y=1 else: i=i+1 e=0 while len(K)>1: if i==N: i=0 else: i+=1 j=0 while len(K)>1 and j