n=int(input()) s=list(map(int,input().split())) i=0;s0=0;s1=0 l=0;r=0;tl=0;tr=0 while i0: l=i s0+=s[i] if s1