Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
W = list(map(int,　input().split()))
 
min_list = []
for i in range(N):
    mi = abs(sum(W[0:i]) - sum(W[i:]))
    min_list.append(mi)
print(min(min_list))

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
W = list(map(int,input().split()))
 
min_list = []
for i in range(N):
    mi = abs(sum(W[0:i]) - sum(W[i:]))
    min_list.append(mi)
print(min(min_list))

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))
 
ans = 10000
for i in range(N):
    mi = abs(sum(W[0:i]) - sum(W[i:])
    if mi < ans:
        ans = mi
print(ans)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))
 
ans = 10000
for i in range(N):
    mi = abs(sum(W[0:i]) - sum(W[i:])
    if mi < ans:
        ans = mi
print(ans)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int,input().split()))
 
ans = 10000
for i in range(N+1):
    if abs(sum(W[0:i]) - sum(W[i:]) < min_first:
        ans = abs(sum(W[0:i]) - sum(W[i:])
print(ans)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
W = list(map(int,input().split()))

ans = 10000
for i in range(N):
    dif = abs(sum(W[0:i])-sum(W[i:]))
    if dif < ans:
        ans = dif 
    else:
        pass
print(ans)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
W = list(map(int,input().split()))

min_first = 10000
for i in range(N):
    m = abs(sum(W[0:i])-sum(W[i:])
    if m < min_first:
        m = min_first
    else:
        pass
print(m)

Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)

Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
W = list(map(int,input().split()))

min_list = []
for i in range(N):
    S1 = sum(W[0:i])
    S2 = sum(W) - sum(W[0:i])
    mi = abs(S1-S2)
    min_list.append(mi)
print(min(min_list))


Fixed submission:
n = int(input())
w = list(map(int, input().split()))
 
min_diff = 1000
for i in range(n):
	diff = abs(sum(w[0:i]) - sum(w[i:]))
	if diff < min_diff:
		min_diff = diff
print(min_diff)