n = int(input())
w = list(map(int, input().split()))

s = sum(w[1:])
t = w[0]

m = 100000

for i in range(1, n):
    m = min(m, abs(s-t))
    s -= w[i]
    t += 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 s = sum(w[1:]) s sum(w[1:]) sum w[1:] w 1: 1 t = w[0] t w[0] w 0 m = 100000 m 100000 for i in range(1, n):
    m = min(m, abs(s-t))
    s -= w[i]
    t += w[i] i range(1, n) range 1 n m = min(m, abs(s-t)) m min(m, abs(s-t)) min m abs(s-t) abs s-t s t s -= w[i] s w[i] w i t += w[i] t w[i] w i print(m) print m s -= w[i] w[i] s s = sum(w[1:]) sum(w[1:]) s n = int(input()) int(input()) n t = w[0] w[0] t t += w[i] w[i] t m = 100000 100000 m w = list(map(int, input().split())) list(map(int, input().split())) w m = min(m, abs(s-t)) min(m, abs(s-t)) m
n = int(input())
w = list(map(int, input().split()))

s = sum(w[1:])
t = w[0]

m = 100000

for i in range(1, n):
    m = min(m, abs(s-t))
    s -= w[i]
    t += w[i]

print(m)
