n=int(input())
myarr=list(map(int,input().split()))
 
val=1000
 
for i in range(1,n):
    temp=abs(sum(myarr[0:i])-sum(myarr[i:]))
    val=min(val,temp)
 
print(val) n=int(input()) n int(input()) int input() input myarr=list(map(int,input().split())) myarr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split val=1000 val 1000 for i in range(1,n):
    temp=abs(sum(myarr[0:i])-sum(myarr[i:]))
    val=min(val,temp)
  i range(1,n) range 1 n temp=abs(sum(myarr[0:i])-sum(myarr[i:])) temp abs(sum(myarr[0:i])-sum(myarr[i:])) abs sum(myarr[0:i])-sum(myarr[i:]) sum(myarr[0:i]) sum myarr[0:i] myarr 0:i 0 i sum(myarr[i:]) sum myarr[i:] myarr i: i val=min(val,temp) val min(val,temp) min val temp print(val) print val myarr=list(map(int,input().split())) list(map(int,input().split())) myarr val=1000 1000 val n=int(input()) int(input()) n temp=abs(sum(myarr[0:i])-sum(myarr[i:])) abs(sum(myarr[0:i])-sum(myarr[i:])) temp val=min(val,temp) min(val,temp) val
n=int(input())
myarr=list(map(int,input().split()))
 
val=1000
 
for i in range(1,n):
    temp=abs(sum(myarr[0:i])-sum(myarr[i:]))
    val=min(val,temp)
 
print(val)