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

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

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