n=int(input())
w=list(map(int,input().split()))
min=100
for i in range(n-1):
    if min >= abs(sum(w[:i+1])-sum(w[i+1:])):
        min = abs(sum(w[:i+1])-sum(w[i+1:]))
print(min) 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 min=100 min 100 for i in range(n-1):
    if min >= abs(sum(w[:i+1])-sum(w[i+1:])):
        min = abs(sum(w[:i+1])-sum(w[i+1:])) i range(n-1) range n-1 n 1 if min >= abs(sum(w[:i+1])-sum(w[i+1:])):
        min = abs(sum(w[:i+1])-sum(w[i+1:])) min >= abs(sum(w[:i+1])-sum(w[i+1:])) min 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 min = abs(sum(w[:i+1])-sum(w[i+1:])) min 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(min) print min w=list(map(int,input().split())) list(map(int,input().split())) w min = abs(sum(w[:i+1])-sum(w[i+1:])) abs(sum(w[:i+1])-sum(w[i+1:])) min min=100 100 min n=int(input()) int(input()) n
n=int(input())
w=list(map(int,input().split()))
min=100
for i in range(n-1):
    if min >= abs(sum(w[:i+1])-sum(w[i+1:])):
        min = abs(sum(w[:i+1])-sum(w[i+1:]))
print(min)