N=int(input()) A=[int(x) for x in input().split()] a=0 x=0 y=1 u=0 while u