n = int(input())
apple = list(map(int, input().split()))
a = 100000
for i in range(1, n):
    a = min(a, abs(sum(apple[:i]) - sum(apple[i:])))
print(a) n = int(input()) n int(input()) int input() input apple = list(map(int, input().split())) apple list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a = 100000 a 100000 for i in range(1, n):
    a = min(a, abs(sum(apple[:i]) - sum(apple[i:]))) i range(1, n) range 1 n a = min(a, abs(sum(apple[:i]) - sum(apple[i:]))) a min(a, abs(sum(apple[:i]) - sum(apple[i:]))) min a abs(sum(apple[:i]) - sum(apple[i:])) abs sum(apple[:i]) - sum(apple[i:]) sum(apple[:i]) sum apple[:i] apple :i i sum(apple[i:]) sum apple[i:] apple i: i print(a) print a a = 100000 100000 a a = min(a, abs(sum(apple[:i]) - sum(apple[i:]))) min(a, abs(sum(apple[:i]) - sum(apple[i:]))) a n = int(input()) int(input()) n apple = list(map(int, input().split())) list(map(int, input().split())) apple
n = int(input())
apple = list(map(int, input().split()))
a = 100000
for i in range(1, n):
    a = min(a, abs(sum(apple[:i]) - sum(apple[i:])))
print(a)