n=int(input())
w=list(map(int,input().split()))
ans=n*100
for i in range(n):
  ans=min(ans,abs(sum(w[:i+1])-sum(w[i+1:])))
print(ans) n=int(input()) n int(input()) int input() input w=list(map(int,input().split())) w list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=n*100 ans n*100 n 100 for i in range(n):
  ans=min(ans,abs(sum(w[:i+1])-sum(w[i+1:]))) i range(n) range n ans=min(ans,abs(sum(w[:i+1])-sum(w[i+1:]))) ans min(ans,abs(sum(w[:i+1])-sum(w[i+1:]))) min ans abs(sum(w[:i+1])-sum(w[i+1:])) abs sum(w[:i+1])-sum(w[i+1:]) sum(w[:i+1]) sum w[:i+1] w :i+1 i+1 i 1 sum(w[i+1:]) sum w[i+1:] w i+1: i+1 i 1 print(ans) print ans n=int(input()) int(input()) n ans=n*100 n*100 ans w=list(map(int,input().split())) list(map(int,input().split())) w ans=min(ans,abs(sum(w[:i+1])-sum(w[i+1:]))) min(ans,abs(sum(w[:i+1])-sum(w[i+1:]))) ans
n=int(input())
w=list(map(int,input().split()))
ans=n*100
for i in range(n):
  ans=min(ans,abs(sum(w[:i+1])-sum(w[i+1:])))
print(ans)