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