N = int(input())
W_list = list(map(int, input().split()))

answer = 10**5
for i in range(N):
    answer = min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer)
    
print(answer) N = int(input()) N int(input()) int input() input W_list = list(map(int, input().split())) W_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split answer = 10**5 answer 10**5 10 5 for i in range(N):
    answer = min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer)
     i range(N) range N answer = min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer) answer min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer) min abs(sum(W_list[:i]) - sum(W_list[i:])) abs sum(W_list[:i]) - sum(W_list[i:]) sum(W_list[:i]) sum W_list[:i] W_list :i i sum(W_list[i:]) sum W_list[i:] W_list i: i answer print(answer) print answer W_list = list(map(int, input().split())) list(map(int, input().split())) W_list answer = 10**5 10**5 answer answer = min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer) min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer) answer N = int(input()) int(input()) N
N = int(input())
W_list = list(map(int, input().split()))

answer = 10**5
for i in range(N):
    answer = min(abs(sum(W_list[:i]) - sum(W_list[i:])), answer)
    
print(answer)