Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)

Fixed submission:
l=map(str,raw_input().split())
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)

Buggy python submission (verdict: Runtime Error):
import re
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)

Fixed submission:
l=map(str,raw_input().split())
ans=[]
for i in l:
    if 'peach' in i:
        ans.append(i.replace('peach','apple'))
    elif 'apple' in i:
        ans.append(i.replace('apple','peach'))
    else:
        ans.append(i)
print ' '.join(ans)
Buggy python submission (verdict: Runtime Error):
def a(v1,v2):
    if v1[0]!=v2[0]:
        return (v2[1]-v1[1])/(v2[0]-v1[0])
    else:
        return (v2[1]-v1[1])*(10**10)

def dlt(p,v,sign):
    while len(p)>2:
        if sign*(a(v[p[-3]],v[p[-2]])-a(v[p[-2]],v[p[-1]]))<0:
            del p[-2]
        else:
            break
    return p

def convex(v,n):
    d,u=[],[]
    for i in range(n):
        d=dlt(d+[i],v,1)
        u=dlt(u+[i],v,-1)
    return n-len(set(d+u))

while 1:
    n=int(raw_input())
    if n==0:
        break
    v=[map(float,raw_input().splirt(',')) for i in range(n)]
    v=sorted(sorted(v,key=lambda x:x[1]))
    print convex(v,n)

Fixed submission:
def a(v1,v2):
    if v1[0]!=v2[0]:
        return (v2[1]-v1[1])/(v2[0]-v1[0])
    else:
        return (v2[1]-v1[1])*(10**10)

def dlt(p,v,sign):
    while len(p)>2:
        if sign*(a(v[p[-3]],v[p[-2]])-a(v[p[-2]],v[p[-1]]))<0:
            del p[-2]
        else:
            break
    return p

def convex(v,n):
    d,u=[],[]
    for i in range(n):
        d=dlt(d+[i],v,1)
        u=dlt(u+[i],v,-1)
    return n-len(set(d+u))

while 1:
    n=int(raw_input())
    if n==0:
        break
    v=[map(float,raw_input().split(',')) for i in range(n)]
    v=sorted(sorted(v,key=lambda x:x[1]))
    print convex(v,n)
Buggy python submission (verdict: Runtime Error):
def bomb(f,x,y):
    rf=f[:][:]
    rf[y][x]=0
    for i in [-3,-2,-1,1,2,3]:
        if 0<=x+i<=7:
            if rf[y][x+i]==1:
                rf=bomb(rf,x+i,y)
        if 0<=y+i<=7:
            if rf[y+i][x]==1:
                rf=bomb(rf,x,y+i)
    return rf

n=int(raw_input())
for data in range(1,n+1):
    raw_input()
    f=[]
    for i in range(8):
        l.append([int(x) for x in raw_input()])
    x=int(raw_input())-1
    y=int(raw_input())-1
       # map(int,raw_input().split())
    f=bomb(f,x,y)
    print "Data %d:"%(data)
    for i in range(8):
        print ''.join(map(str, f[i]))

Fixed submission:
def bomb(f,x,y):
    rf=f[:][:]
    rf[y][x]=0
    for i in [-3,-2,-1,1,2,3]:
        if 0<=x+i<=7:
            if rf[y][x+i]==1:
                rf=bomb(rf,x+i,y)
        if 0<=y+i<=7:
            if rf[y+i][x]==1:
                rf=bomb(rf,x,y+i)
    return rf

n=int(raw_input())
for data in range(1,n+1):
    raw_input()
    f=[]
    for i in range(8):
        f.append([int(x) for x in raw_input()])
    x=int(raw_input())-1
    y=int(raw_input())-1
       # map(int,raw_input().split())
    f=bomb(f,x,y)
    print "Data %d:"%(data)
    for i in range(8):
        print ''.join(map(str, f[i]))
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,raw_input().split())
ans=[0]*n
for i in range(q):
    a,v=map(int,raw_input().split())
    ans[a-1]+=v
    t=ans.index(max(ans))
    print t+1,ans[t]
exit()

Fixed submission:
n,q=map(int,raw_input().split())
ans=[0]*n
key=value=0
for i in range(q):
    a,v=map(int,raw_input().split())
    a-=1
    ans[a]+=v
    if a==key and v<0:
        value=max(ans)
        key=ans.index(value)
    elif ans[a]>value:
        key=a
        value=ans[a]
    elif ans[a]==value and a<key:
        key=a
    print key+1,value

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,raw_input().split())
ans=[0]*n
t=-1
for i in range(q):
    a,v=map(int,raw_input().split())
    ans[a-1]+=v
    if v<0:
        t=-1
    if t==-1:
        t=ans.index(max(ans))
    elif ans[t]<ans[a-1] or (ans[t]==ans[a-1] and t>a-1):
        t=a-1
    print t+1,ans[t]
exit()

Fixed submission:
n,q=map(int,raw_input().split())
ans=[0]*n
key=value=0
for i in range(q):
    a,v=map(int,raw_input().split())
    a-=1
    ans[a]+=v
    if a==key and v<0:
        value=max(ans)
        key=ans.index(value)
    elif ans[a]>value:
        key=a
        value=ans[a]
    elif ans[a]==value and a<key:
        key=a
    print key+1,value

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,raw_input().split())
ans={}
t=-1
for i in range(q):
    a,v=map(int,raw_input().split())
    if ans.has_key(a):
        ans[a]+=v
    else:
        ans[a]=v
    if t==-1:
        t=a
    elif ans[a]>ans[t] or (ans[a]==ans[t] and a<t):
        t=a

    if v<0:
        t=-1
    if t==-1:
        for i in ans:
            if t==-1:
                t=i
            elif ans[t]<ans[i]:
                t=i
            elif ans[t]==ans[i] and t>i:
                t=i
    print t,ans[t]
exit()

Fixed submission:
n,q=map(int,raw_input().split())
ans=[0]*n
key=value=0
for i in range(q):
    a,v=map(int,raw_input().split())
    a-=1
    ans[a]+=v
    if a==key and v<0:
        value=max(ans)
        key=ans.index(value)
    elif ans[a]>value:
        key=a
        value=ans[a]
    elif ans[a]==value and a<key:
        key=a
    print key+1,value
Buggy python submission (verdict: Runtime Error):
l=[]
while 1:
    n,k=map(int,raw_input().split())
    cnt+=1
    if n==k==0:
        break
    l.append(n+k)
    if cnt%5==0:
        print chr(l.index(max(l))+65),max(l)
        l=[]

Fixed submission:
cnt=0
l=[]
while 1:
    n,k=map(int,raw_input().split())
    cnt+=1
    if n==k==0:
        break
    l.append(n+k)
    if cnt%5==0:
        print chr(l.index(max(l))+65),max(l)
        l=[]
Buggy python submission (verdict: Runtime Error):
n=input()
l=[input() for _ in range(n)]
mi=l.index(min(l))
ma=l.index(max(l))
print max(max(l)-min(l[:ma]),max(l[mi:])-min(l))

Fixed submission:
n=input()
l=[input() for _ in range(n)]
chk,ans=l[0],-1000000000
for i in range(1,n):
    chk=min(chk,l[i-1])
    if l[i]-chk>ans:
        ans=l[i]-chk
print ans
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()

def bubble(cards):
    for i in range(len(cards)):
        for j in range(len(cards)-1, i, -1):
            if cards[j][1]<cards[j-1][1]:
                cards[j],cards[j-1]=cards[j-1],cards[j]

def selection(cards):
    for i in range(len(cards)):
        mini=i
        for j in range(i,len(cards)):
            if cards[j][1]<cards[mini][1]:
                mini=j
        cards[i],cards[mini]=cards[mini],cards[i]

def stabel_test(orders,cards):
    for order in orders:
        n=-1
        for c in order:
            p=n
            n=cards.index(c)
            if p>n:
                return False
    return True

sys.stdin.readline()
data1=sys.stdin.readline().split()
data2=data1[:]
orders=[[c for c in data1 if c.endswitch(str(i))] for i in range(1,10)]
orders=[o for o in orders if len(c)>1]

bubble(data1)
print(*data1)
print('Stable' if stabel_test(orders, data1) else 'Not stable')

selection(data2)
print(*data2)
print('Stable' if stable_test(orders, data2) else 'Not stable')

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()

def bubble(cards):
    for i in range(len(cards)):
        for j in range(len(cards)-1, i, -1):
            if cards[j][1]<cards[j-1][1]:
                cards[j],cards[j-1]=cards[j-1],cards[j]

def selection(cards):
    for i in range(len(cards)):
        mini=i
        for j in range(i,len(cards)):
            if cards[j][1]<cards[mini][1]:
                mini=j
        cards[i],cards[mini]=cards[mini],cards[i]

def stable_test(orders,cards):
    for order in orders:
        n=-1
        for c in order:
            p=n
            n=cards.index(c)
            if p>n:
                return False
    return True

sys.stdin.readline()
data1=sys.stdin.readline().split()
data2=data1[:]
orders=[[c for c in data1 if c.endswith(str(i))] for i in range(1,10)]
orders=[o for o in orders if len(c)>1]

bubble(data1)
print(*data1)
print('Stable' if stable_test(orders, data1) else 'Not stable')

selection(data2)
print(*data2)
print('Stable' if stable_test(orders, data2) else 'Not stable')
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
a,b=[],[]
check = re.compile('insert')
n=input()
#while True:
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if check.search(i):
        a.append(f)
    else:
        b.append(f)
#print a
#print b
#for y in b:
        if f in a:
            print 'yes'
        else:
            print 'no'

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
#check = 'insert'
n=input()
a=set()
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no'

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
a,b=[],[]
check = re.compile('insert')
n=input()
#while True:
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if check.search(i):
        a.append(f)
    else:
#        b.append(f)
#print a
#print b
#for y in b:
        if f in a:
            print 'yes'
        else:
            print 'no'

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
#check = 'insert'
n=input()
a=set()
for x in xrange(n):
    (i,f)=map(str, raw_input().split())
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print 'yes'
        else:
            print 'no'
Buggy python submission (verdict: Runtime Error):
n=int(raw_input())
a=map(int,raw_input().split())
q=int(raw_input())
m=map(int,raw_input().split())
ans=chk=0
bits=(1<<n)-1
for i in m:
    p=bits
    flag=0
    while p:
        chk=str(bin(p))[2:]
        chk='0'*(n-len(chk))+chk
        p-=1
        h=0
        for j,k in enumerate(chk):
            if k=='1':
                h+=a[j]
            if h==i:
                print 'yes'
                p=0
                flag=1
                continue
            elif h>i:
                break
    if flag==0:
        print 'no'

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function,division
import time
import sys
import io
import re
import math
start = time.clock()
i = 0

sys.stdin.readline()
a=[int(s) for s in sys.stdin.readline().split()]
sys.stdin.readline()
ms=[int(s) for s in sys.stdin.readline().split()]
ans=set([0])
for i in a:
    ans|=set(j+i for j in ans)
ans=list(ans)
for jk in ms:
    if jk in ans: print('yes')
    else: print('no')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function,division
from itertools import combinations
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
def enum_sum_numbers(sets, s_range, r):
    for cmb in combinations(sets,r):
        yield sum(cmb)
    if r <=s_range:
        for s in enum_sum_numbers(sets,s_range, r+1):
            yield s

sys.stdin.readline()
a=[int(s) for s in sys.stdin.readline().split()]
sys.stdin.readline()
ms=[int(s) for s in sys.stdin.readline().split()]
sets={s for s in enum_sum_numbers(a,len(a)),1}
for m in ms:
    print('yes' if m in sets else 'no')

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function,division
import time
import sys
import io
import re
import math
start = time.clock()
i = 0

sys.stdin.readline()
a=[int(s) for s in sys.stdin.readline().split()]
sys.stdin.readline()
ms=[int(s) for s in sys.stdin.readline().split()]
ans=set([0])
for i in a:
    ans|=set(j+i for j in ans)
ans=list(ans)
for jk in ms:
    if jk in ans: print('yes')
    else: print('no')
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,raw_input().split())
x=x2-x1
y=y2-y1
print (x**2+y**2)**0.5

Fixed submission:
(n,m,o,p) = map(float, raw_input().split())
print ((n-o)**2 + (m-p)**2)**0.5

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

n = map(int, raw_input().split())
ans=math.sqrt((n[0]-n[2])**2 + (n[1]-n[3])**2)
print ans

Fixed submission:
(n,m,o,p) = map(float, raw_input().split())
print ((n-o)**2 + (m-p)**2)**0.5

Buggy python submission (verdict: Runtime Error):
(n,m,o,p) = map(int, raw_input().split())
print ((n-o)**2 + (m-p)**2)**0.5

Fixed submission:
(n,m,o,p) = map(float, raw_input().split())
print ((n-o)**2 + (m-p)**2)**0.5
Buggy python submission (verdict: Runtime Error):
a,b,C=map(float,raw_input().split())
rad=math.radinas(C)
c=(a**2+b**2-2*a*b*math.cos(rad))
h=b*math.sin(c)
print h*a/2
print a+b+c
print h

Fixed submission:
import math

(n,m,o) = map(float, raw_input().split())
#s=(n+m+o)/2.0
c=math.radians(o)
cs=math.sqrt(n**2+m**2-2*n*m*math.cos(c))
h=m*math.sin(c)
#ans=(s*(s-m)*(s-n)*(s-o))**0.5
#print ((n-o)**2 + (m-p)**2)**0.5
#print ans
S=h*n/2
L=n+m+cs
print S
print L
print h

Buggy python submission (verdict: Runtime Error):
import math
a,b,C=map(float,raw_input().split())
rad=math.radinas(C)
c=(a**2+b**2-2*a*b*math.cos(rad))
h=b*math.sin(c)
print h*a/2
print a+b+c
print h

Fixed submission:
import math

(n,m,o) = map(float, raw_input().split())
#s=(n+m+o)/2.0
c=math.radians(o)
cs=math.sqrt(n**2+m**2-2*n*m*math.cos(c))
h=m*math.sin(c)
#ans=(s*(s-m)*(s-n)*(s-o))**0.5
#print ((n-o)**2 + (m-p)**2)**0.5
#print ans
S=h*n/2
L=n+m+cs
print S
print L
print h

Buggy python submission (verdict: Runtime Error):
a,b,C=map(float,raw_input().split())
rad=math.radians(C)
c=(a**2+b**2-2*a*b*math.cos(rad))**0.5
h=b*math.sin(rad)
print h*a/2
print a+b+c
print h

Fixed submission:
import math

(n,m,o) = map(float, raw_input().split())
#s=(n+m+o)/2.0
c=math.radians(o)
cs=math.sqrt(n**2+m**2-2*n*m*math.cos(c))
h=m*math.sin(c)
#ans=(s*(s-m)*(s-n)*(s-o))**0.5
#print ((n-o)**2 + (m-p)**2)**0.5
#print ans
S=h*n/2
L=n+m+cs
print S
print L
print h
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import io
import re
import math

while True:
#    i = 0
    n = int(raw_input())
    l = map(float, raw_input().split())
    if n==0: break
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    print avg
    naka=0
    for i in l:
        print naka
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import io
import re
import math

while True:
#    i = 0
    n = int(raw_input())
    if n==0: break
    l = map(float, raw_input().split())
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    naka=0
    for i in l:
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

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

while True:
    n = int(raw_input())
    l = map(float, raw_input().split())
    if n==0:
    break
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    print avg
    naka=0
    for i in l:
        print naka
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import io
import re
import math

while True:
#    i = 0
    n = int(raw_input())
    if n==0: break
    l = map(float, raw_input().split())
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    naka=0
    for i in l:
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

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

while True:
#    i = 0
    n = int(raw_input())
    l = map(float, raw_input().split())
    if n==0: break
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    naka=0
    for i in l:
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import io
import re
import math

while True:
#    i = 0
    n = int(raw_input())
    if n==0: break
    l = map(float, raw_input().split())
# hyojunhensa**2 = sum(tokuten-heikinten)**2)/ninzu
    avg=sum(l)/len(l)
    naka=0
    for i in l:
        naka+=(i-avg)**2
    hyo2 = naka/n
    print (hyo2)**0.5
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys
import io
import re
import math
import itertools
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
#start = time.clock()
ans=chk=0
a=[0,2,5,3]
b=[0,1,5,4]

def rolling(word,dice):
    if word=='S':
        dice[0],dice[1],dice[5],dice[4]=dice[4],dice[0],dice[1],dice[5]
    elif word=='N':
        dice[0],dice[1],dice[5],dice[4]=dice[1],dice[5],dice[4],dice[0]
    elif word=='W':
        dice[0],dice[2],dice[5],dice[3]=dice[2],dice[5],dice[3],dice[0]
    else:
        dice[0],dice[2],dice[5],dice[3]=dice[3],dice[0],dice[2],dice[5]
    return dice

def sortdice(dice1,dice2,p,q):
    for i in range(4):
        dice1[p[0]],dice1[p[1]],dice1[p[2]],dice1[p[3]]=dice1[p[1]],dice1[p[2]],dice1[p[3]],dice1[p[0]]
        for j in range(4):
            dice1[q[0]],dice1[q[1]],dice1[q[2]],dice1[q[3]]=dice1[q[1]],dice1[q[2]],dice1[q[3]],dice1[q[0]]
            if dice1==dice2:
                print 'Yes'
                exit()
    return 0

l1=map(int,raw_input().split())
l2=map(int,raw_input().split())
sortdice(l1,l2,a,b)
print 'No'

Fixed submission:
l=map(int,raw_input().split())
n=raw_input()
ans=chk=0


def rolling(word,dice):
    if word=='S':
        dice[0],dice[1],dice[5],dice[4]=dice[4],dice[0],dice[1],dice[5]
    elif word=='N':
        dice[0],dice[1],dice[5],dice[4]=dice[1],dice[5],dice[4],dice[0]
    elif word=='W':
        dice[0],dice[2],dice[5],dice[3]=dice[2],dice[5],dice[3],dice[0]
    else:
        dice[0],dice[2],dice[5],dice[3]=dice[3],dice[0],dice[2],dice[5]
    return dice

for i in n:
    l=rolling(i,l)
print l[0]
Buggy python submission (verdict: Runtime Error):
print int(raw_input())**3

Fixed submission:
i=int(raw_input())
print i**3
Buggy python submission (verdict: Runtime Error):
m,n,o=map(int, raw_input().split())
print'Yes' if m<n<o else:print 'No'

Fixed submission:
(m,n,o)=map(int, raw_input().split())
if m<n & n<o: print 'Yes'
else: print 'No'
Buggy python submission (verdict: Runtime Error):
for i,w in enumerate(sys.stdin):
    print 'Case %s: ' % str(i+1) +w[:-1]

Fixed submission:
import sys
for i,ws in enumerate(sys.stdin, 1):
    w = ws[:-1]
    if w =='0': break
    print 'Case %d: %s' % (i, w)
Buggy python submission (verdict: Runtime Error):
while True:
    i = map(int, raw_input().split())
    if i[1]==0: break
    else: print i[0]/i[1],i[0]%i[1],float(i[0])/i[1]

Fixed submission:
(o,p) = map(int, raw_input().split())
print o/p,o%p,round(float(o)/p,6)
Buggy python submission (verdict: Runtime Error):
o = int(raw_input())
print o*o*3.141592653589,o*2*3.141592653589

Fixed submission:
from decimal import Decimal
o = float(raw_input())
print Decimal(o*o*3.141592653589),Decimal(o*2*3.141592653589)
Buggy python submission (verdict: Runtime Error):
    (m,n)=map(int, raw_input().split())
    if n==0 & m==0 : break
    else: print ((('#'*n)+'\n')*m)

Fixed submission:
while True:
    (m,n)=map(int, raw_input().split())
    if n==0 and m==0: break
    else: print (('#'*n+'\n')*m)

Buggy python submission (verdict: Runtime Error):
    (m,n)=map(int, raw_input().split())
    if n==0 & m==0 : break
    else: print ((('#'*n)'\n')*m)

Fixed submission:
while True:
    (m,n)=map(int, raw_input().split())
    if n==0 and m==0: break
    else: print (('#'*n+'\n')*m)

Buggy python submission (verdict: Runtime Error):
    (m,n)=map(int, raw_input().split())
    if n==0 and m==0 : break
    else: print ((('#'*n)'\n')*m)

Fixed submission:
while True:
    (m,n)=map(int, raw_input().split())
    if n==0 and m==0: break
    else: print (('#'*n+'\n')*m)
Buggy python submission (verdict: Runtime Error):
while True:
    n=int(raw_input())
    m=map(int, raw_input().split())
    m.sort()
    h=-1
    for i in xrange(n):
        print str(m[h]),
        h-=1
    print

Fixed submission:
n=int(raw_input())
m=map(int, raw_input().split())
m.reverse()
print " ".join(map(str, m))
Buggy python submission (verdict: Runtime Error):
r,c=map(int,raw_input().split())
l=[]
for i in range(r):l.append(map(int,raw_input().split()))
l.append([0]*c)
for i in range(c):
    for j in range(r):l[c-1][i]+=l[j][i]
    l[i].append(sum(l[i]))
for i in range(r+1):print' '.join(map(str,l[i]))

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import sys
import io
import re
import math
#start = time.time()
start = time.clock()
l=[]
m=[]
s=[]
(r,c)=map(int, raw_input().split())
for i in range(r):
    l.append(map(int, raw_input().split()))
### ???????????則??\?????????
for cc in range(c):
    a=0
    for rr in range(r):
        a+=int(l[rr][cc])
#        print int(l[rr][cc])
    s.append(a)
for j in range(r):
    print ' '.join(map(str,l[j])),str(sum(l[j]))
print ' '.join(map(str,s)),str(sum(s))