n=int(input())
bop=list(map(int,input().split()))
hq=sum(bop)

for i in range(1,n):
  		hq=min(hq, abs(sum(bop[:i])-sum(bop[i:n])))

print(hq) n=int(input()) n int(input()) int input() input bop=list(map(int,input().split())) bop list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split hq=sum(bop) hq sum(bop) sum bop for i in range(1,n):
  		hq=min(hq, abs(sum(bop[:i])-sum(bop[i:n]))) i range(1,n) range 1 n hq=min(hq, abs(sum(bop[:i])-sum(bop[i:n]))) hq min(hq, abs(sum(bop[:i])-sum(bop[i:n]))) min hq abs(sum(bop[:i])-sum(bop[i:n])) abs sum(bop[:i])-sum(bop[i:n]) sum(bop[:i]) sum bop[:i] bop :i i sum(bop[i:n]) sum bop[i:n] bop i:n i n print(hq) print hq bop=list(map(int,input().split())) list(map(int,input().split())) bop hq=sum(bop) sum(bop) hq hq=min(hq, abs(sum(bop[:i])-sum(bop[i:n]))) min(hq, abs(sum(bop[:i])-sum(bop[i:n]))) hq n=int(input()) int(input()) n
n=int(input())
bop=list(map(int,input().split()))
hq=sum(bop)

for i in range(1,n):
  		hq=min(hq, abs(sum(bop[:i])-sum(bop[i:n])))

print(hq)