N=int(input())
WList=list(map(int, input().split()))
ANS=max(WList)
for i in range(N):
    ANS=min((abs(sum(WList[:i])-sum(WList[i:]))),ANS)
print(ANS) N=int(input()) N int(input()) int input() input WList=list(map(int, input().split())) WList list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ANS=max(WList) ANS max(WList) max WList for i in range(N):
    ANS=min((abs(sum(WList[:i])-sum(WList[i:]))),ANS) i range(N) range N ANS=min((abs(sum(WList[:i])-sum(WList[i:]))),ANS) ANS min((abs(sum(WList[:i])-sum(WList[i:]))),ANS) min abs(sum(WList[:i])-sum(WList[i:])) abs sum(WList[:i])-sum(WList[i:]) sum(WList[:i]) sum WList[:i] WList :i i sum(WList[i:]) sum WList[i:] WList i: i ANS print(ANS) print ANS ANS=max(WList) max(WList) ANS N=int(input()) int(input()) N ANS=min((abs(sum(WList[:i])-sum(WList[i:]))),ANS) min((abs(sum(WList[:i])-sum(WList[i:]))),ANS) ANS WList=list(map(int, input().split())) list(map(int, input().split())) WList
N=int(input())
WList=list(map(int, input().split()))
ANS=max(WList)
for i in range(N):
    ANS=min((abs(sum(WList[:i])-sum(WList[i:]))),ANS)
print(ANS)