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

b=10000
for i in range(n):
  c=(sum(a[:i+1])-sum(a[i+1:]))**2
  if c<b:
    b=c
print(int(b**0.5)) 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=10000 b 10000 for i in range(n):
  c=(sum(a[:i+1])-sum(a[i+1:]))**2
  if c<b:
    b=c i range(n) range n c=(sum(a[:i+1])-sum(a[i+1:]))**2 c (sum(a[:i+1])-sum(a[i+1:]))**2 sum(a[:i+1])-sum(a[i+1:]) sum(a[:i+1]) sum a[:i+1] a :i+1 i+1 i 1 sum(a[i+1:]) sum a[i+1:] a i+1: i+1 i 1 2 if c<b:
    b=c c<b c b b=c b c print(int(b**0.5)) print int(b**0.5) int b**0.5 b 0.5 b=c c b b=10000 10000 b c=(sum(a[:i+1])-sum(a[i+1:]))**2 (sum(a[:i+1])-sum(a[i+1:]))**2 c a=[int(x) for x in input().split()] [int(x) for x in input().split()] a n=int(input()) int(input()) n
n=int(input())
a=[int(x) for x in input().split()]

b=10000
for i in range(n):
  c=(sum(a[:i+1])-sum(a[i+1:]))**2
  if c<b:
    b=c
print(int(b**0.5))