B=list(map(int,input().split())) for i in range(0,8): if B[i]+1!=B[i+1]: print(B[i]+1) else: break print(10)