Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
special=False
target=input()
if target[0]=="A" and target[-1]=="C" and "B" in target and "ABC" in target:
    pass
else:
    special=True
    
special="True"
old=["ABC"]
new=[]
word=["A","B","C"]
while old != [] or special=True:
    if target in old:
        print("Yes")
        break
    for i in old:
        for j in word:
            new_word=i.replace(j,"ABC")
            if len(new_word)==len(target):
                if new_word==target:
                    new.append(new_word)
                    break
                else:
                    pass
            elif len(new_word)< len(target):
                new.append(new_word)
            else:
                pass
    old=new[:]
    new=[]
else:
    print("No")

Fixed submission:
target=input()
list_abc=["A","B","C"]
old=[]
new=[]
check=[]
flag=False
if "ABC" in target:
    old.append([target,[]])
while old !=[] and flag==False:
    for i in old:
        if i[0]=="ABC":
            check.append(i[1])
            flag=True
            break
        for j in list_abc:
            element=i[0].replace("ABC",j)
            if "ABC" in element:
                new.append([element,i[1]+[j]])
    else:
        old=new[:]
        new=[]
flag=False
for i in check:
    abc="ABC"
    li=i
    li.reverse()
    for j in li:
        abc=abc.replace(j,"ABC")
    if abc==target:
        flag=True
print("Yes" if flag==True else "No")
Buggy python submission (verdict: Runtime Error):
for i in range(1, 10):
  for j in range(1, 10):
    print i + '×' + j + '=' + i*j

Fixed submission:
for i in range(1, 10):
  for j in range(1, 10):
    print str(i) + 'x' + str(j) + '=' + str(i*j)

Buggy python submission (verdict: Runtime Error):
for i in range(1, 10):
  for j in range(1, 10):
    print i + '×' + j + '=' + i*j

Fixed submission:
for i in range(1, 10):
  for j in range(1, 10):
    print str(i) + 'x' + str(j) + '=' + str(i*j)

Buggy python submission (verdict: Runtime Error):
for i in range(1, 10):
  for j in range(1, 10):
    print i + '×' + j + '=' + i*j

Fixed submission:
for i in range(1, 10):
  for j in range(1, 10):
    print str(i) + 'x' + str(j) + '=' + str(i*j)

Buggy python submission (verdict: Runtime Error):
for i in range(1, 10):
  for j in range(1, 10):
    print str(i) + '×' + str(j) + '=' + str(i*j)

Fixed submission:
for i in range(1, 10):
  for j in range(1, 10):
    print str(i) + 'x' + str(j) + '=' + str(i*j)
Buggy python submission (verdict: Runtime Error):
print str(x^3)

Fixed submission:
x = input()
print str(x*x*x)

Buggy python submission (verdict: Runtime Error):
print str(x*x*x)

Fixed submission:
x = input()
print str(x*x*x)
Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split
x = int(x)
y = int(y)
print x*y + " " + x*2 + y*2

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split
n = int(x)
m = int(y)
print n*m + " " + n*2 + m*2

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split()
n = int(x)
m = int(y)
print n*m + " " + n*2 + m*2

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split(" ")
n = int(x)
m = int(y)
print n*m + " " + n*2 + m*2

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split(" ")
n = int(x)
m = int(y)
S = n*m
SUM = n * 2 + m * 2
print S + " " + SUM

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
[x,y] = a.split(" ")
n = int(x)
m = int(y)
S = n*m
SUM = n * 2 + m * 2
print S + " " + SUM

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input().split(" ")
n = int(a[0])
m = int(a[1])
S = n*m
SUM = n * 2 + m * 2
print S + " " + SUM

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = raw_input()
x,y = a.split(" ")
n = int(a[0])
m = int(a[1])
S = n*m
SUM = n * 2 + m * 2
print S + " " + SUM

Fixed submission:
x = raw_input().split(" ")
 
a = int(x[0])
b = int(x[1])
 
print str(a*b) + " " + str(2*(a+b))
Buggy python submission (verdict: Runtime Error):
array = []
for i in range(10):
 line = int(input())
 array += [line]

result = array.sort()[::-1]

print(result[0])
print(result[1])
print(result[2])

Fixed submission:
# coding: utf-8
# Here your code !
array = []
for i in range(10):
 line = int(input())
 array += [line]

result = sorted(array)[::-1]

print(result[0])
print(result[1])
print(result[2])
Buggy python submission (verdict: Runtime Error):
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=(c-b*f/e)/(a-b*d/e)
    y=(c-a*f/d)/(b-a*e/d)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))
    
for i in range(len(ans)):
    print('{0:.4f} {1:.4f}' .format(*ans[i]))

Fixed submission:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    if c*e-b*f==0:
        x=0
    else:
        x=(c*e-b*f)/(a*e-b*d)
    if c*d-a*f==0:
        y=0
    else:
        y=(c*d-a*f)/(b*d-a*e)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(round(ans[i][0],3),round(ans[i][1],3)))

Buggy python submission (verdict: Runtime Error):
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=(c-b*f/e)/(a-b*d/e)
    y=(c-a*f/d)/(b-a*e/d)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))
    
for i in range(len(ans)):
    print('{0:.3f} {1:.3f}' .format(*ans[i]))

Fixed submission:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    if c*e-b*f==0:
        x=0
    else:
        x=(c*e-b*f)/(a*e-b*d)
    if c*d-a*f==0:
        y=0
    else:
        y=(c*d-a*f)/(b*d-a*e)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(round(ans[i][0],3),round(ans[i][1],3)))

Buggy python submission (verdict: Runtime Error):
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=round((c-b*f/e)/(a-b*d/e),3)
    y=round((c-a*f/d)/(b-a*e/d),3)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(*ans[i]))

Fixed submission:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    if c*e-b*f==0:
        x=0
    else:
        x=(c*e-b*f)/(a*e-b*d)
    if c*d-a*f==0:
        y=0
    else:
        y=(c*d-a*f)/(b*d-a*e)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(round(ans[i][0],3),round(ans[i][1],3)))
Buggy python submission (verdict: Runtime Error):
def circum(x1,x2,x3,y1,y2,y3):
    a1 = 2 * (x2 - x1)
    b1 = 2 * (y2 - y1)
    c1 = x1 ** 2 - x2 ** 2 + y1 **2 - y2 ** 2
    a2 = 2 * (x3 - x1)
    b2 = 2 * (y3 - y1)
    c2 = x1 ** 2 - x3 ** 2 + y1 **2 - y3 ** 2
    X = (b1 * c2 - b2 * c1)/(a1 * b2 - a2 * b1)
    Y = (c1 * a2 - c2 * a1)/(a1 * b2 - a2 * b1)
    R = ((x1 - X) ** 2 + (y1 - Y) ** 2) ** 0.5
    return map(lambda n: round(n,3), [X,Y,R])
N = int(input())
ans = []
for i in range(N):
    ans.append(circum(*list(map(float,input().split()))))
for i in range(N):
    print('{0:.3f} {1:.3f} {2:.3f}'.format(*ans[i]))

Fixed submission:
def circum(x1,y1,x2,y2,x3,y3):
    a1 = 2 * (x2 - x1)
    b1 = 2 * (y2 - y1)
    c1 = x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2
    a2 = 2 * (x3 - x1)
    b2 = 2 * (y3 - y1)
    c2 = x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2
    X = (b1 * c2 - b2 * c1)/(a1 * b2 - a2 * b1)
    Y = (c1 * a2 - c2 * a1)/(a1 * b2 - a2 * b1)
    R = ((x1 - X) ** 2 + (y1 - Y) ** 2) ** 0.5
    return map(lambda n: round(n,3), [X,Y,R])
N = int(input())
ans = []
for i in range(N):
    ans.append(circum(*list(map(float,input().split()))))
for i in range(N):
    print('{0:.3f} {1:.3f} {2:.3f}'.format(*ans[i]))
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        b = input()
    except:
        break
    if 'the' in c or 'this' in c or 'that' in b:
        print(c)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c

Fixed submission:
while True:
    try:
        b = input()
    except:
        break
    if 'the' in b or 'this' in b or 'that' in b:
        print(b)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c
Buggy python submission (verdict: Runtime Error):
for i in range(int(input())):
    s = list(map(float,input().split()))
    if (s[0] - s[2]) / (s[1] - s[3]) == (s[4] - s[6]) / (s[5] - s[7]):
        print('YES')
    else:
        print('NO')

Fixed submission:
for i in range(int(input())):
    s = list(map(float,input().split()))
    if s[1] - s[3] == 0 or s[5] - s[7] == 0:
        if s[1] - s[3] == s[5] - s[7] == 0:
            print('YES')
        else:
            print('NO')
    elif abs((s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7])) < 1e-10:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Runtime Error):
while True:
    n = int(input())
    if n == 0:
        break
    dp = [0]
    for i in range(n):
        a = int(input()))
        dp[i] = (max(dp[i] + a, a))
    print(max(dp))

Fixed submission:
while True:
    n = int(input())
    if n == 0:
        break
    dp = [-1e6]
    for i in range(n):
        a = int(input())
        dp.append(max(dp[i] + a, a))
    print(max(dp))
Buggy python submission (verdict: Runtime Error):
a, md = [], []
c, mx = 1, 1
while True:
    try:
        a.append(int(input()))
    except EOFError:
        break
a = sorted(a)
print(a)
for i in range(0, len(a) - 1):
    if a[i] == a[i + 1]:
        c += 1
    else:
        c = 1
    if mx < c:
        mx = c
        md = [a[i]]
    elif mx == c:
        md.append(a[i])
print('\n'.join(map(str, sorted(md)))

Fixed submission:
a = []
ary = [0] * 101
while True:
    try:
        c = int(input())
    except EOFError:
        break
    a.append(c)
    ary[c] += 1
for i in range(1, 101):
    if ary[i] == max(ary):
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    com = input().split()
    if com[0] == "insert":
        key = int(com[1]) 
        l.insert(0, int(key))
    elif com[0] == "delete":
        key = int(com[1]) 
        if int(key) in l:
            l.remove(int(key))
    elif com[0] == "deleteFirst":
        del l[0]
    else:
        del l[-1]
print(*l)

Fixed submission:
import sys
from collections import deque
 
n = int(sys.stdin.readline())
que = deque()
for i in range(n):
    line = sys.stdin.readline()
    op = line.rstrip().split()
    if "insert" == op[0]:
        que.appendleft(op[1])
    elif "delete" == op[0]:
        if op[1] in que:
            que.remove(op[1])
    elif "deleteFirst" == op[0]:
        que.popleft()
    else:
        que.pop()
 
print(*que)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    com = input().split()
    if com[0] == "insert":
        key = int(com[1]) 
        l.insert(0, int(key))
    elif com[0] == "delete":
        key = int(com[1]) 
        if int(key) in l:
            l.remove(int(key))
    elif com[0] == "deleteFirst":
        del l[0]
    else:
        del l[-1]
print(*l)

Fixed submission:
import sys
from collections import deque
 
n = int(sys.stdin.readline())
que = deque()
for i in range(n):
    line = sys.stdin.readline()
    op = line.rstrip().split()
    if "insert" == op[0]:
        que.appendleft(op[1])
    elif "delete" == op[0]:
        if op[1] in que:
            que.remove(op[1])
    elif "deleteFirst" == op[0]:
        que.popleft()
    else:
        que.pop()
 
print(*que)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    com = input().split()
    if com[0] == "insert":
        key = int(com[1]) 
        l.insert(0, key)
    elif com[0] == "delete":
        key = int(com[1]) 
        if int(key) in l:
            l.remove(key)
    elif com[0] == "deleteFirst":
        del l[0]
    else:
        del l[-1]
print(*l)

Fixed submission:
import sys
from collections import deque
 
n = int(sys.stdin.readline())
que = deque()
for i in range(n):
    line = sys.stdin.readline()
    op = line.rstrip().split()
    if "insert" == op[0]:
        que.appendleft(op[1])
    elif "delete" == op[0]:
        if op[1] in que:
            que.remove(op[1])
    elif "deleteFirst" == op[0]:
        que.popleft()
    else:
        que.pop()
 
print(*que)
Buggy python submission (verdict: Runtime Error):
import sys
for i in sys.stdin:
    n = int(raw_input())
    num_a = 0
    num_b = 0
    for j in range(n):
        ta, tb = map(int,raw_input().split())
        if ta > tb:
            num_a += (ta+tb)
        elif ta < tb:
            num_b += (ta+tb)
        else:
            num_a += ta
            num_b += tb
    print "%d %d" % (num_a, num_b)

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    num_a = 0
    num_b = 0
    for j in range(n):
        ta, tb = map(int,raw_input().split())
        if ta > tb:
            num_a += (ta+tb)
        elif ta < tb:
            num_b += (ta+tb)
        else:
            num_a += ta
            num_b += tb
    print "%d %d" % (num_a, num_b)

Buggy python submission (verdict: Runtime Error):
import sys
for i in sys.stdin:
    n = int(i)
    num_a = 0
    num_b = 0
    for j in range(n):
        ta, tb = map(int,raw_input().split())
        if ta > tb:
            num_a += (ta+tb)
        elif ta < tb:
            num_b += (ta+tb)
        else:
            num_a += ta
            num_b += tb
    print "%d %d" % (num_a, num_b)

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    num_a = 0
    num_b = 0
    for j in range(n):
        ta, tb = map(int,raw_input().split())
        if ta > tb:
            num_a += (ta+tb)
        elif ta < tb:
            num_b += (ta+tb)
        else:
            num_a += ta
            num_b += tb
    print "%d %d" % (num_a, num_b)
Buggy python submission (verdict: Runtime Error):
a = [raw_input().split(" ")]
a.sort()
print "%s %s %s" % (a[0],a[1],a[2])

Fixed submission:
a = raw_input().split(" ")
a.sort()
print "%s %s %s" % (a[0],a[1],a[2])
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = raw_input().split(" ")
if 0<(x+r)<W && 0<(y+r)<H:
    print "Yes"
else:
    print "No"

Fixed submission:
a = raw_input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])
r = int(a[4])
if (x - r) >= 0 and (x + r) <= W and (y - r) >= 0 and (y + r) <= H:
    print "Yes"
else:
    print "No"

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = raw_input().split(" ")
if (x+r)<W and 0<(x-r) and 0<(y-r) and (y+r)<H:
    print "Yes"
else:
    print "No"

Fixed submission:
a = raw_input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])
r = int(a[4])
if (x - r) >= 0 and (x + r) <= W and (y - r) >= 0 and (y + r) <= H:
    print "Yes"
else:
    print "No"

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = raw_input().split(" ")
if (x+r)<=W and 0<=(x-r) and 0<=(y-r) and (y+r)<=H:
    print "Yes"
else:
    print "No"

Fixed submission:
a = raw_input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])
r = int(a[4])
if (x - r) >= 0 and (x + r) <= W and (y - r) >= 0 and (y + r) <= H:
    print "Yes"
else:
    print "No"

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = raw_input().split(" ")
if (x+r)<W and 0<(x-r) and 0<(y-r) and (y+r)<H:
    print "Yes"
else:
    print "No"

Fixed submission:
a = raw_input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])
r = int(a[4])
if (x - r) >= 0 and (x + r) <= W and (y - r) >= 0 and (y + r) <= H:
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
n=input()
loan=10**5
for i in xrange(n):
    loan+=loan*0.05
    if loan%1000!=0:
        loan-=loan%1000
        loan+=10**3
    else:
        loan-=loan%1000
print(int(loan)

Fixed submission:
n=input()
loan=10**5
for i in xrange(n):
    loan+=loan*0.05
    if loan%1000!=0:
        loan-=loan%1000
        loan+=10**3
    else:
        loan-=loan%1000
print(int(loan))
Buggy python submission (verdict: Time Limit Exceeded):
def isPrime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    if pow(2,x-1,x)==1:
        return True
    else:
        return False
while 1:
    try:
        n=input()
        ct=0
        for i in xrange(n+1):
            if isPrime(i):
                ct+=1
        print(ct)
    except:
        break

Fixed submission:
def sieve(n):
    p=0
    prime=[0]*n
    is_prime=[0]*(n+1)
    for i in xrange(n+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in xrange(2,n+1):
        if is_prime[i]:
            p+=1
            prime[p]=i
            for j in xrange(2*i,n+1,i):
                is_prime[j]=False
    return p
while 1:
    try:
        n=input()
        print(sieve(n))
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
def isPrime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    if pow(2,x-1,x)==1:
        return True
    else:
        return False
while 1:
    try:
        n=input()
        ct=1
        if n==2:
            print(1)
        else:
            for i in xrange(3,n+1,2):
                if isPrime(i):
                    ct+=1
            print(ct)
    except:
        break

Fixed submission:
def sieve(n):
    p=0
    prime=[0]*n
    is_prime=[0]*(n+1)
    for i in xrange(n+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in xrange(2,n+1):
        if is_prime[i]:
            p+=1
            prime[p]=i
            for j in xrange(2*i,n+1,i):
                is_prime[j]=False
    return p
while 1:
    try:
        n=input()
        print(sieve(n))
    except:
        break
Buggy python submission (verdict: Runtime Error):
n=map(str,raw_imput().split())
n.sort()
n.reverse()
print(' '.join(n))

Fixed submission:
n=map(int,raw_input().split())
n.sort()
n.reverse()
n=map(str,n)
print(" ".join(n))

Buggy python submission (verdict: Runtime Error):
n=map(str,raw_imput().split())
n.sort()
n.reverse()
print(' '.join(n))

Fixed submission:
n=map(int,raw_input().split())
n.sort()
n.reverse()
n=map(str,n)
print(" ".join(n))

Buggy python submission (verdict: Runtime Error):
n=map(int,raw_imput().split())
ans=[]
n.sort()
n.reverse()
for i in n:
	ans.append(str(i))
print(' '.join(ans))

Fixed submission:
n=map(int,raw_input().split())
n.sort()
n.reverse()
n=map(str,n)
print(" ".join(n))
Buggy python submission (verdict: Time Limit Exceeded):
while 1:
    n=input()
    if n==0:
        break
    else:
        a=[input() for _ in xrange(n)]
        ans=-float('inf')
        for i in xrange(n):
            for j in xrange(i,n):
                if ans<sum(a[i:j+1]):
                    ans=sum(a[i:j+1])
        print(ans)

Fixed submission:
while 1:
    n=input()
    if n==0:break
    a=[int(raw_input()) for _ in xrange(n)]
    wa=[0]*(n+1)
    max_a=-1000000
    for i in xrange(n):
        wa[i+1]=a[i]+wa[i]
    for i in xrange(n):
        for j in xrange(i+1,n+1):
            if max_a<wa[j]-wa[i]:
                max_a=wa[j]-wa[i]
    print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
    n=input()
    if n==0:
        break
    else:
        a=[input() for _ in xrange(n)]
        ans=-float('inf')
        for i in xrange(n):
            for j in xrange(i,n):
                suma=sum(a[i:j+1])
                if ans<suma:
                    ans=suma
        print(ans)

Fixed submission:
while 1:
    n=input()
    if n==0:break
    a=[int(raw_input()) for _ in xrange(n)]
    wa=[0]*(n+1)
    max_a=-1000000
    for i in xrange(n):
        wa[i+1]=a[i]+wa[i]
    for i in xrange(n):
        for j in xrange(i+1,n+1):
            if max_a<wa[j]-wa[i]:
                max_a=wa[j]-wa[i]
    print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
    n=input()
    if n==0:break
    a=[int(raw_input()) for _ in xrange(n)]
    max_a=-1000000
    for i in xrange(n):
        for j in xrange(i+1,n+1):
            if max_a<sum(a[i:j]):
                max_a=sum(a[i:j])
    print(max_a)

Fixed submission:
while 1:
    n=input()
    if n==0:break
    a=[int(raw_input()) for _ in xrange(n)]
    wa=[0]*(n+1)
    max_a=-1000000
    for i in xrange(n):
        wa[i+1]=a[i]+wa[i]
    for i in xrange(n):
        for j in xrange(i+1,n+1):
            if max_a<wa[j]-wa[i]:
                max_a=wa[j]-wa[i]
    print(max_a)
Buggy python submission (verdict: Runtime Error):
import string
sen=map(str,raw_input().split())
ans=[]
for i in sen:
    if i[0:5]=="apple":
        if len(i)>5:
            ans.append("peach"+i[5:])
        else:
            ans.appned("peach")
    elif i[0:5]=="peach":
        if len(i)>5:
            ans.append("apple"+i[5:])
        else:
            ans.append("apple")
    else:
        ans.append(i)
print(" ".join(ans))

Fixed submission:
sen=raw_input()
sen=sen.replace("apple","?????")
sen=sen.replace("peach","apple")
sen=sen.replace("?????","peach")
print(sen)

Buggy python submission (verdict: Runtime Error):
sen=map(str,raw_input().split())
ans=[]
for i in sen:
    if len(i)>=5:
        if i[0:5]=="apple":
            if len(i)>5:
                ans.append("peach"+i[5:])
            else:
                ans.appned("peach")
        elif i[0:5]=="peach":
            if len(i)>5:
                ans.append("apple"+i[5:])
            else:
                ans.append("apple")
        else:
            ans.append(i)
    else:
        ans.append(i)
print(" ".join(ans))

Fixed submission:
sen=raw_input()
sen=sen.replace("apple","?????")
sen=sen.replace("peach","apple")
sen=sen.replace("?????","peach")
print(sen)
Buggy python submission (verdict: Runtime Error):
def third_root(q):
    x=q/2.0
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=input()
    if q==-1:break
    ans=third_root(q)
    print(ans)

Fixed submission:
def third_root(q):
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=eval(input())
    if q==-1:break
    ans=third_root(q)
    print(ans)

Buggy python submission (verdict: Runtime Error):
def third_root(q):
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=input()
    if q==-1:break
    ans=third_root(q)
    print(ans)

Fixed submission:
def third_root(q):
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=eval(input())
    if q==-1:break
    ans=third_root(q)
    print(ans)