Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

lis = []
lis2 = []

def sum(lis):
  s = 0
  for e in lis:
    s += e
  return s

while True:
  num = input()
  if num == 0:
    break
  else:
    lis = []
    lis2 = []
    for i in range(num):
      lis.append(input())
    for i in range(len(lis)):
      for j in range(i+1,len(lis)+1):
        lis2.append(sum(lis[i:j]))
    print max(lis2)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

lis = []
lis2 = []

def sum(lis):
  s = 0
  for e in lis:
    s += e
  return s

while True:
  num = input()
  if num == 0:
    break
  else:
    lis = []
    lis2 = []
    maxnum = -99999
    for i in range(num):
      lis.append(input())
    for i in range(len(lis)):
      for j in range(i+1,len(lis)+1):
        su = sum(lis[i:j])
        if su > maxnum:
          maxnum = su
    print maxnum

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

lis = []
lis2 = []

def sum(lis):
  s = 0
  for e in lis:
    s += e
  return s

while True:
  num = input()
  if num == 0:
    break
  else:
    lis = []
    lis2 = []
    for i in range(num):
      n = input()
      if i == 0:
        d = n
      else:
        d = max( d + n , n )
        lis.append(d)    
    print max(lis)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

lis = []
lis2 = []


while True:
  num = input()
  if num == 0:
    break
  else:
    lis = []
    for i in range(num):
      n = input()
      if i == 0:
        d = n
      else:
        d = max( d + n , n )
        lis.append(d)    
    print max(lis)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = []
  for i in range(num):
    n = input()
    if i == 0:
      d = n
    else:
      d = max( d + n , n )
      lis.append(d)    
  print max(lis)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
  num = input()
  if num == 0:
    break
  lis = [0]*num
  for i in range(num):
    n = input()
    if i == 0:
      lis[0] = n
    else:
      lis[i] = max( lis[i-1] + n , n )
  print max(lis)