N = int(input())
res = []
arr = list(map(int,input().split()))
for i in range(N-1):
    res.append(abs(sum(arr[:i+1])-sum(arr[i+1:])))
print(min(res)) N = int(input()) N int(input()) int input() input res = [] res [] arr = list(map(int,input().split())) arr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(N-1):
    res.append(abs(sum(arr[:i+1])-sum(arr[i+1:]))) i range(N-1) range N-1 N 1 res.append(abs(sum(arr[:i+1])-sum(arr[i+1:]))) res.append res append abs(sum(arr[:i+1])-sum(arr[i+1:])) abs sum(arr[:i+1])-sum(arr[i+1:]) sum(arr[:i+1]) sum arr[:i+1] arr :i+1 i+1 i 1 sum(arr[i+1:]) sum arr[i+1:] arr i+1: i+1 i 1 print(min(res)) print min(res) min res N = int(input()) int(input()) N arr = list(map(int,input().split())) list(map(int,input().split())) arr res = [] [] res
N = int(input())
res = []
arr = list(map(int,input().split()))
for i in range(N-1):
    res.append(abs(sum(arr[:i+1])-sum(arr[i+1:])))
print(min(res))