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