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

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

print(min(abs(sum(W[:i])-sum(W[i:])) for i in range(1, N)))
