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

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

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

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

print(min(Abs))