n=int(input())
a=[int(x) for x in input().split()]

b=100
for i in range(1,n):
  c=abs(sum(a[:i])-sum(a[i:]))
  if c<b:
    b=c
print(b) n=int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a=[int(x) for x in input().split()] a [int(x) for x in input().split()] b=100 b 100 for i in range(1,n):
  c=abs(sum(a[:i])-sum(a[i:]))
  if c<b:
    b=c i range(1,n) range 1 n c=abs(sum(a[:i])-sum(a[i:])) c abs(sum(a[:i])-sum(a[i:])) abs sum(a[:i])-sum(a[i:]) sum(a[:i]) sum a[:i] a :i i sum(a[i:]) sum a[i:] a i: i if c<b:
    b=c c<b c b b=c b c print(b) print b b=100 100 b n=int(input()) int(input()) n a=[int(x) for x in input().split()] [int(x) for x in input().split()] a c=abs(sum(a[:i])-sum(a[i:])) abs(sum(a[:i])-sum(a[i:])) c b=c c b
n=int(input())
a=[int(x) for x in input().split()]

b=100
for i in range(1,n):
  c=abs(sum(a[:i])-sum(a[i:]))
  if c<b:
    b=c
print(b)