I,R=input,range J=lambda:map(int,I().split()) N,*_=J() A=list(J()) S=[0]*(N+2) i=j=s=0 while i