N=int(input())
Wls=list(map(int,input().split()))

accum_Wls=[0]
for W in Wls:
    accum_Wls.append(accum_Wls[-1]+W)

# print(accum_Wls)

ans=10**9+13

for i in range (1,N):
    temp=abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i])
    if temp<ans:
        ans=temp

print(ans) N=int(input()) N int(input()) int input() input Wls=list(map(int,input().split())) Wls list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split accum_Wls=[0] accum_Wls [0] 0 for W in Wls:
    accum_Wls.append(accum_Wls[-1]+W)

# print(accum_Wls) W Wls accum_Wls.append(accum_Wls[-1]+W) accum_Wls.append accum_Wls append accum_Wls[-1]+W accum_Wls[-1] accum_Wls -1 W ans=10**9+13 ans 10**9+13 10**9 10 9 13 for i in range (1,N):
    temp=abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i])
    if temp<ans:
        ans=temp i range (1,N) range 1 N temp=abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i]) temp abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i]) abs (accum_Wls[-1]-accum_Wls[i])-accum_Wls[i] accum_Wls[-1]-accum_Wls[i] accum_Wls[-1] accum_Wls -1 accum_Wls[i] accum_Wls i accum_Wls[i] accum_Wls i if temp<ans:
        ans=temp temp<ans temp ans ans=temp ans temp print(ans) print ans temp=abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i]) abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i]) temp ans=temp temp ans ans=10**9+13 10**9+13 ans N=int(input()) int(input()) N accum_Wls=[0] [0] accum_Wls Wls=list(map(int,input().split())) list(map(int,input().split())) Wls
N=int(input())
Wls=list(map(int,input().split()))

accum_Wls=[0]
for W in Wls:
    accum_Wls.append(accum_Wls[-1]+W)

# print(accum_Wls)

ans=10**9+13

for i in range (1,N):
    temp=abs((accum_Wls[-1]-accum_Wls[i])-accum_Wls[i])
    if temp<ans:
        ans=temp

print(ans)