n = int(input())
lst = list(map(int, input().split()))
res = 10 ** 10
for i in range(1, n):
  res = min(res, abs(sum(lst[:i]) - sum(lst[i:])))
print(res) n = int(input()) n int(input()) int input() input lst = list(map(int, input().split())) lst list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split res = 10 ** 10 res 10 ** 10 10 10 for i in range(1, n):
  res = min(res, abs(sum(lst[:i]) - sum(lst[i:]))) i range(1, n) range 1 n res = min(res, abs(sum(lst[:i]) - sum(lst[i:]))) res min(res, abs(sum(lst[:i]) - sum(lst[i:]))) min res abs(sum(lst[:i]) - sum(lst[i:])) abs sum(lst[:i]) - sum(lst[i:]) sum(lst[:i]) sum lst[:i] lst :i i sum(lst[i:]) sum lst[i:] lst i: i print(res) print res res = 10 ** 10 10 ** 10 res res = min(res, abs(sum(lst[:i]) - sum(lst[i:]))) min(res, abs(sum(lst[:i]) - sum(lst[i:]))) res n = int(input()) int(input()) n lst = list(map(int, input().split())) list(map(int, input().split())) lst
n = int(input())
lst = list(map(int, input().split()))
res = 10 ** 10
for i in range(1, n):
  res = min(res, abs(sum(lst[:i]) - sum(lst[i:])))
print(res)