N = int(input())
W = [int(x) for x in input().split()]
WL = list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1))
print(min(WL)) 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 W = [int(x) for x in input().split()] W [int(x) for x in input().split()] WL = list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1)) WL list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1)) list abs(sum(W[:x])-sum(W[x:])) abs sum(W[:x])-sum(W[x:]) sum(W[:x]) sum W[:x] W :x x sum(W[x:]) sum W[x:] W x: x print(min(WL)) print min(WL) min WL N = int(input()) int(input()) N WL = list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1)) list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1)) WL W = [int(x) for x in input().split()] [int(x) for x in input().split()] W
N = int(input())
W = [int(x) for x in input().split()]
WL = list(abs(sum(W[:x])-sum(W[x:])) for x in range(0,N+1))
print(min(WL))