N = int(input())
W = list(map(int,input().split()))
zettaiti_dayo=[]

for i in range(1,N):
    zettaiti_dayo.append(abs(sum(W[:i])-sum(W[i:])))

print(min(zettaiti_dayo)) 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 zettaiti_dayo=[] zettaiti_dayo [] for i in range(1,N):
    zettaiti_dayo.append(abs(sum(W[:i])-sum(W[i:]))) i range(1,N) range 1 N zettaiti_dayo.append(abs(sum(W[:i])-sum(W[i:]))) zettaiti_dayo.append zettaiti_dayo append abs(sum(W[:i])-sum(W[i:])) abs sum(W[:i])-sum(W[i:]) sum(W[:i]) sum W[:i] W :i i sum(W[i:]) sum W[i:] W i: i print(min(zettaiti_dayo)) print min(zettaiti_dayo) min zettaiti_dayo W = list(map(int,input().split())) list(map(int,input().split())) W N = int(input()) int(input()) N zettaiti_dayo=[] [] zettaiti_dayo
N = int(input())
W = list(map(int,input().split()))
zettaiti_dayo=[]

for i in range(1,N):
    zettaiti_dayo.append(abs(sum(W[:i])-sum(W[i:])))

print(min(zettaiti_dayo))
