Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = []
    for i in range(n):
        numbers.append(int(raw_input()))
    sigmas = []
    for i in range(1,n+1):
        for j in range(n+1-i):
            sigmas.append(reduce(lambda x,y:x+y,numbers[j:j+i+1]))
    print max(sigmas)

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    if max(numbers) <= 0:
        print max(numbers)
    else:
        ans = 0
        for i in range(n):
            tmp = 0
            for j in range(i,n):
                tmp += numbers[j]
                if(ans<tmp):
                    ans = tmp
        print ans

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = []
    for i in range(n):
        numbers.append(int(raw_input()))
    sigmas = []
    for i in range(1,n+1):
        for j in range(n+1-i):
            sigmas.append(reduce(lambda x,y:x+y,numbers[j:j+i+1]))
    print reduce(lambda x,y:x>y if x else y,sigmas)

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    if max(numbers) <= 0:
        print max(numbers)
    else:
        ans = 0
        for i in range(n):
            tmp = 0
            for j in range(i,n):
                tmp += numbers[j]
                if(ans<tmp):
                    ans = tmp
        print ans

Buggy python submission (verdict: Runtime Error):
def inc(x):
    return x+1
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    pointers = filter(lambda x:x[0]<x[1], map(lambda x:(x/n,x%n+1),xrange(n*n)))
    ans = 0
    for pointer in pointers:
        tmp = reduce(lambda x,y:x+y,numbers[pointer[0],pointer[1]])
        ans = tmp > ans if tmp else ans
    print ans

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    if max(numbers) <= 0:
        print max(numbers)
    else:
        ans = 0
        for i in range(n):
            tmp = 0
            for j in range(i,n):
                tmp += numbers[j]
                if(ans<tmp):
                    ans = tmp
        print ans

Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    if max(numbers) <= 0:
        return max(numbers)
    ans = 0
    for i in range(n):
        tmp = 0
        for j in range(i,n):
            tmp += numbers[j]
            ans = max(ans,tmp)
    print ans

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    numbers = [int(raw_input()) for i in range(n)]
    if max(numbers) <= 0:
        print max(numbers)
    else:
        ans = 0
        for i in range(n):
            tmp = 0
            for j in range(i,n):
                tmp += numbers[j]
                if(ans<tmp):
                    ans = tmp
        print ans