output_description: Print the minimum possible absolute difference of S_1 and S_2.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      W_1 W_2 ... W_{N-1} W_N
attempt: n = int(input())
  l = [int(x) for x in input().split()]
  min_sum = -1
  for t in l:
      s1 = l[:t]
      s2 = l[t:]
      s1_sum = sum(s1)
      s2_sum = sum(s2)
      if min_sum < 0 or min_sum > abs(s1_sum - s2_sum):
          min_sum = abs(s1_sum - s2_sum)
  print(min_sum)
  
problem_description: Statement
  
  We have N weights indexed 1 to N. The mass of the weight indexed i is W_i.
  
  We will divide these weights into two groups: the weights with indices not
  greater than T, and those with indices greater than T, for some integer 1 \leq
  T < N. Let S_1 be the sum of the masses of the weights in the former group,
  and S_2 be the sum of the masses of the weights in the latter group.
  
  Consider all possible such divisions and find the minimum possible absolute
  difference of S_1 and S_2.
samples: [{"input": "3\n    1 2 3", "output": "0\n    \n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\n* * *"}, {"input": "4\n    1 3 1 1", "output": "2\n    \n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of\n2. We cannot have a smaller absolute difference.\n\n* * *"}, {"input": "8\n    27 23 76 2 3 5 62 52", "output": "2"}]