N = int(input())
W = [int(n) for n in input().split()]
ans = 10**9
for t in range(1, N):
    ans = min(ans, abs(sum(W[:t]) - sum(W[t:])))
print(ans) N = int(input()) N int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n W = [int(n) for n in input().split()] W [int(n) for n in input().split()] ans = 10**9 ans 10**9 10 9 for t in range(1, N):
    ans = min(ans, abs(sum(W[:t]) - sum(W[t:]))) t range(1, N) range 1 N ans = min(ans, abs(sum(W[:t]) - sum(W[t:]))) ans min(ans, abs(sum(W[:t]) - sum(W[t:]))) min ans abs(sum(W[:t]) - sum(W[t:])) abs sum(W[:t]) - sum(W[t:]) sum(W[:t]) sum W[:t] W :t t sum(W[t:]) sum W[t:] W t: t print(ans) print ans ans = 10**9 10**9 ans ans = min(ans, abs(sum(W[:t]) - sum(W[t:]))) min(ans, abs(sum(W[:t]) - sum(W[t:]))) ans N = int(input()) int(input()) N W = [int(n) for n in input().split()] [int(n) for n in input().split()] W
N = int(input())
W = [int(n) for n in input().split()]
ans = 10**9
for t in range(1, N):
    ans = min(ans, abs(sum(W[:t]) - sum(W[t:])))
print(ans)
