Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import math
num = []
cyou, hisi = 0, 0
for i in sys.stdin:
	num = map(int, i.split(","))
	kaku = math.acos(num[0]/num[1])*(180/math.pi)
	if kaku == 90:
		cyou += 1
	elif num[0] == num[1]:
		hisi += 1

print cyou
print hisi

Fixed submission:
import sys
cyou, hisi = 0, 0
for i in sys.stdin:
	x,y,z = map(int, i.split(","))
	if x**2+y**2 == z**2:
		cyou += 1
	elif x == y:
		hisi += 1
print cyou
print hisi
Buggy python submission (verdict: Runtime Error):
for i in xrange(input()):
	n = sorted(raw_input())
	x = int("".join(n[::-1]))
	for j in xrange(len(n)):
		if n[i] == "0": del n[i]
		else: break
	print x - int("".join(n))

Fixed submission:
for i in xrange(input()):
	s = sorted([s for s in raw_input()])
	print int("".join(reversed(s))) - int("".join(s))

Buggy python submission (verdict: Runtime Error):
#encoding=utf-8

for i in xrange(input()):
	n = sorted(raw_input())
	x = int("".join(n[::-1]))
	for j in xrange(len(n)):
		if n[i] == "0": del n[i]
		else: break
	print x - int("".join(n))

Fixed submission:
for i in xrange(input()):
	s = sorted([s for s in raw_input()])
	print int("".join(reversed(s))) - int("".join(s))
Buggy python submission (verdict: Runtime Error):
#encoding=utf-8

import sys
import math

printf = sys.stdout.write

x1,y1,x2,y2 = map(int,raw_input().split())

X = x2 - x1
Y = y2 - y1
printf(str(math.sqrt(X**2 + Y**2)))

Fixed submission:
#encoding=utf-8

import sys
import math

printf = sys.stdout.write

x1,y1,x2,y2 = map(float,raw_input().split())

X = x2 - x1
Y = y2 - y1
printf(str(math.sqrt(X**2 + Y**2)))
Buggy python submission (verdict: Runtime Error):
n = input()
print n**3
print \n

Fixed submission:
n = input()
print n**3
Buggy python submission (verdict: Runtime Error):
import sys

argv = sys.argv
x = int(argv[1])
y = int(args[2])
print x*y,
print 2*x+2*y,

Fixed submission:
num = map(int, raw_input().split())
print num[0]*num[1], 2*(num[0] + num[1])

Buggy python submission (verdict: Runtime Error):
import sys
argv = sys.argv
x = int(argv[1])
y = int(argv[2])
print x*y,
print 2*x+2*y

Fixed submission:
num = map(int, raw_input().split())
print num[0]*num[1], 2*(num[0] + num[1])

Buggy python submission (verdict: Runtime Error):
import sys
argv = sys.argv
x = int(argv[1])
y = int(argv[2])
print x*y,
print " "
print 2*x+2*y

Fixed submission:
num = map(int, raw_input().split())
print num[0]*num[1], 2*(num[0] + num[1])

Buggy python submission (verdict: Runtime Error):
import sys
argv = sys.argv
x = int(argv[1])
y = int(argv[2])
print x*y,
print " ",
print 2*x+2*y

Fixed submission:
num = map(int, raw_input().split())
print num[0]*num[1], 2*(num[0] + num[1])
Buggy python submission (verdict: Runtime Error):
import sys

N = input()
num =[input() for i in range(N)]
for i in range(len(num)):
    print "Case 1: " + num[i]

Fixed submission:
i = 0
while True:
    i += 1
    num = raw_input()
    if num == "0":
        break
    print "Case %d: %s" % (i,num)

Buggy python submission (verdict: Runtime Error):
i = 0
while True:
    i += 1
    num = raw_input()
    if x == '0':
        break
    print "Case %d: %s" % (i,x)

Fixed submission:
i = 0
while True:
    i += 1
    num = raw_input()
    if num == "0":
        break
    print "Case %d: %s" % (i,num)

Buggy python submission (verdict: Runtime Error):
i = 0
while True:
    i += 1
    num = raw_input()
    if len(num) == 0:
        break
    print "Case %d: %s" % (i,num)

Fixed submission:
i = 0
while True:
    i += 1
    num = raw_input()
    if num == "0":
        break
    print "Case %d: %s" % (i,num)
Buggy python submission (verdict: Runtime Error):
while True:
    num = map(int, raw_input().split())
    if len(num) != 1:
        print max(num),min(num),sum(num)

Fixed submission:
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break

Buggy python submission (verdict: Runtime Error):
while True:
    num = map(int, raw_input().split())
    if len(num) != 1:
        print max(num),min(num),sum(num),

Fixed submission:
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break

Buggy python submission (verdict: Runtime Error):
while True:
    num = map(int, raw_input().split())
    if len(num) != 1:
        print "%d %d %d" % (min(num),max(num),sum(num))
        break

Fixed submission:
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break

Buggy python submission (verdict: Runtime Error):
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    if len(num) != 1:
        print "%d %d %d" % (min(num),max(num),sum(num))
        break

Fixed submission:
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break
Buggy python submission (verdict: Runtime Error):
import sys

h,w = map(int,raw_input().split())
if h == 0 and w == 0:
    break

for i in range(h):
    for j in range(w):
        sys.stdout.write("#")
    if i != h-1:print "\n",

Fixed submission:
while True:
    h,w = map(int, raw_input().split())
    if h == w == 0:
        break
    print (("#" * w + "\n") * h)
Buggy python submission (verdict: Runtime Error):
while True:
    sute = map(int,raw_input().split()) 
    num = map(int,raw_input().split())
    for i in range(len(num) - 1):
        print "%d" % num[len(num) - i - 1],
    print num[0]

Fixed submission:
sute = map(int,raw_input().split()) 
num = map(int,raw_input().split())
for i in range(len(num) - 1):
    print "%d" % num[len(num) - i - 1],
print num[0]
Buggy python submission (verdict: Runtime Error):
num = []
while True:
    m,f,r = map(int, raw_input().split())
    if m = -1:
        m = 0
    if f = -1:
        f = 0

    ans = m + f
    if m == f == r == -1:
        break

    if ans >= 80:
        num.append("A")
    elif (65 <= ans) and (ans < 80):
        num.append("B")
    elif (50 <= ans) and (ans < 65):
        num.append("C")
    elif (30 <= ans) and (ans < 50):
        if r >= 50:
            num.append("C")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]

Fixed submission:
num = []
while True:
    m,f,r = map(int, raw_input().split())

    ans = m + f
    if m == f == r == -1:
        break
    if (m == -1) or (f == -1):
        num.append("F")
    elif ans >= 80:
        num.append("A")
    elif (65 <= ans) and (ans < 80):
        num.append("B")
    elif (50 <= ans) and (ans < 65):
        num.append("C")
    elif (30 <= ans) and (ans < 50):
        if r >= 50:
            num.append("C")
        else:
            num.append("D")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]
Buggy python submission (verdict: Runtime Error):
mat = []
new_map = []

r,c = map(int, raw_input().split())
for i in range(r):
    mat = map(int, raw_input().split())
    new_map.append(mat)


for i in range(r):
    new_map[i].append(sum(new_map[i][:]))
    for j in range(c):
        print new_map[i][j],
    printf(" " + str(new_map[i][j + 1]) + "\n")


for j in range(c + 1):
    a = 0
    for i in range(r):
        a += new_map[i][j]
    if j == c:
        printf(" " + str(a) + "\n")
        break
    else:
        print a,

Fixed submission:
import sys

printf = sys.stdout.write


mat = []
new_map = []

r,c = map(int, raw_input().split())
for i in range(r):
    mat = map(int, raw_input().split())
    new_map.append(mat)


for i in range(r):
    new_map[i].append(sum(new_map[i][:]))
    for j in range(c):
        print new_map[i][j],
    printf(" " + str(new_map[i][j + 1]) + "\n")


for j in range(c + 1):
    a = 0
    for i in range(r):
        a += new_map[i][j]
    if j == c:
        printf(" " + str(a) + "\n")
        break
    else:
        print a,

Buggy python submission (verdict: Runtime Error):
#-*- encoding=utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt
import sys

printf = sys.stdout.write


mat = []
new_map = []

r,c = map(int, raw_input().split())
for i in range(r):
    mat = map(int, raw_input().split())
    new_map.append(mat)


for i in range(r):
    new_map[i].append(sum(new_map[i][:]))
    for j in range(c):
        print new_map[i][j],
    printf(" " + str(new_map[i][j + 1]) + "\n")


for j in range(c + 1):
    a = 0
    for i in range(r):
        a += new_map[i][j]
    if j == c:
        printf(" " + str(a) + "\n")
        break
    else:
        print a,

Fixed submission:
import sys

printf = sys.stdout.write


mat = []
new_map = []

r,c = map(int, raw_input().split())
for i in range(r):
    mat = map(int, raw_input().split())
    new_map.append(mat)


for i in range(r):
    new_map[i].append(sum(new_map[i][:]))
    for j in range(c):
        print new_map[i][j],
    printf(" " + str(new_map[i][j + 1]) + "\n")


for j in range(c + 1):
    a = 0
    for i in range(r):
        a += new_map[i][j]
    if j == c:
        printf(" " + str(a) + "\n")
        break
    else:
        print a,
Buggy python submission (verdict: Runtime Error):
while True:
	try:
		x,y=map(int,input().split())
		print(int(math.log10(x+y))+1)
	except EOFError:
		break

Fixed submission:
import math
while True:
	try:
		x,y=map(int,input().split())
		print(int(math.log10(x+y))+1)
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
while True:
	try:
		A=[int(j) for j in input().split()]
		a=A[3]/A[0]
		for i in range(3):
			A[i]*=a
		for i in range(3):
			A[i]=A[i]-A[i+3]
		y=A[2]/A[1]
		x=(A[5]-A[4]*y)/A[3]
		print(x,y)
	except EOFError:
		break

Fixed submission:
while True:
    try:
        l=list(map(int, input().split()))
        x=(l[1]*l[5]-l[2]*l[4])/(l[1]*l[3]-l[0]*l[4])
        y=(l[2]-l[0]*x)/l[1]
        if x == 0: x = 0
        print( "{0:.3f} {1:.3f}".format(x,y))
    except:
        break

Buggy python submission (verdict: Runtime Error):
while True:
	try:
		A=[int(j) for j in input().split()]
		a=A[3]/A[0]
		for i in range(3):
			A[i]*=a
		for i in range(3):
			A[i]=A[i]-A[i+3]
		y=A[2]/A[1]
		x=(A[5]-A[4]*y)/A[3]
		print("%f %f"%(x+0,y+0))
	except EOFError:
		break

Fixed submission:
while True:
    try:
        l=list(map(int, input().split()))
        x=(l[1]*l[5]-l[2]*l[4])/(l[1]*l[3]-l[0]*l[4])
        y=(l[2]-l[0]*x)/l[1]
        if x == 0: x = 0
        print( "{0:.3f} {1:.3f}".format(x,y))
    except:
        break
Buggy python submission (verdict: Runtime Error):
n=int(input())
for _ in range(n):
	s=int(input())+int(input())
	print('overflow' iflen(str(s))>80 else s)

Fixed submission:
n=int(input())
for _ in range(n):
	s=int(input())+int(input())
	print('overflow' if len(str(s))>80 else s)
Buggy python submission (verdict: Runtime Error):
from math import factorical
print(factorical(int(input())))

Fixed submission:
from math import factorial
print(factorial(int(input())))

Buggy python submission (verdict: Runtime Error):
from math import factorical
print(factorical(int(input()))

Fixed submission:
from math import factorial
print(factorial(int(input())))

Buggy python submission (verdict: Runtime Error):
from math import factorical
print(factorical(int(input()))

Fixed submission:
from math import factorial
print(factorial(int(input())))

Buggy python submission (verdict: Runtime Error):
from math import factorial
print(factorial(int(input()))

Fixed submission:
from math import factorial
print(factorial(int(input())))
Buggy python submission (verdict: Runtime Error):
def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	a,b=0,0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(5100)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break

Fixed submission:
def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(50021)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(5003)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break

Fixed submission:
def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(50021)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
def Class(x):
	if x<=48.0:
		print("light fly")
	elif 48.0<x<=51.0:
		print("fly")
	elif 51.0<x<=54.0:
		print("bantam")
	elif 54.0<x<=57.0:
		print("feather")
	elif 57.0<x<=60.0:
		print("light")
	elif 60.0<x<=64.0:
		print("light welter")
	elif 64.0<x<=69.0:
		print("welter")
	elif 69.0<x<=75.0:
		print("light middle")
	elif 75.0<x<=81.0:
		print("middle")
	elif 81.0<x<=91.0:
		print("light heavy")
	else:
		ptinr("heavy")

while True:
	try:
		x=float(input())
		Class(x)
	except EOFError:
		break

Fixed submission:
def Class(x):
	if x<=48.0:
		print("light fly")
	elif 48.0<x<=51.0:
		print("fly")
	elif 51.0<x<=54.0:
		print("bantam")
	elif 54.0<x<=57.0:
		print("feather")
	elif 57.0<x<=60.0:
		print("light")
	elif 60.0<x<=64.0:
		print("light welter")
	elif 64.0<x<=69.0:
		print("welter")
	elif 69.0<x<=75.0:
		print("light middle")
	elif 75.0<x<=81.0:
		print("middle")
	elif 81.0<x<=91.0:
		print("light heavy")
	else:
		print("heavy")

while True:
	try:
		x=float(input())
		Class(x)
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
def solve(xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2):
	if xb2<xa1 or xb1>xa2 or yb2<ya1 or yb1>yb2:
		print("NO")
	else:
		print("YES")


while True:
	try:
		xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2=map(float,input().split())
		solve(xa,ya1,xa1,ya2,xb1,yb1,xb2,yb2)
	except EOFError:
		break

Fixed submission:
def solve(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2):
	if xb2<xa1 or xb1>xa2 or yb2<ya1 or yb1>ya2:
		print("NO")
	else:
		print("YES")


while True:
	try:
		xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2=map(float,input().split())
		solve(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2)
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
#distance
import math
x1,y1,x2,y2=map(int,input().split())
distance = math.sqru((x2-x1)**2+(y2-y1)**2)
print(distance)

Fixed submission:
#distance
import math
x1,y1,x2,y2=map(float,input().split())
distance = math.sqrt((x2-x1)**2+(y2-y1)**2)
print(distance)

Buggy python submission (verdict: Runtime Error):
#distance
import math
x1,y1,x2,y2=map(int,input().split())
distance = math.sqrt((x2-x1)**2+(y2-y1)**2)
print(distance)

Fixed submission:
#distance
import math
x1,y1,x2,y2=map(float,input().split())
distance = math.sqrt((x2-x1)**2+(y2-y1)**2)
print(distance)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(int(a)*int(b))

Fixed submission:
a,b = map(int,input().split())
print(a*b,2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(int(a)*int(b),2*(int(a)+int(b))

Fixed submission:
a,b = map(int,input().split())
print(a*b,2*(a+b))

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(int(a)*int(b),2*(int(a)+int(b)))

Fixed submission:
a,b = map(int,input().split())
print(a*b,2*(a+b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
print(a*b,2*(a+b))

Fixed submission:
a,b = map(int,input().split())
print(a*b,2*(a+b))
Buggy python submission (verdict: Runtime Error):
#No4.py
s = input()
h = s/(60*60)
m = s - h*60*60
s = s - h*60*60 - m*60
print(h+":"+m+":"+s)

Fixed submission:
#No4.py
s = int(input())
h = s//(60*60)
m = (s-h*60*60)//60
s = s-h*60*60-m*60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
#No4.py
s = int(input())
h = s//(60*60)
m = s - h*60*60
s = s - h*60*60 - m*60
print(h+":"+m+":"+s)

Fixed submission:
#No4.py
s = int(input())
h = s//(60*60)
m = (s-h*60*60)//60
s = s-h*60*60-m*60
print(str(h)+":"+str(m)+":"+str(s))
Buggy python submission (verdict: Runtime Error):
x=map(int, input().split())
x.sort()
print(x[0],x[1],x[2])

Fixed submission:
x=list(map(int, input().split()))
x.sort()
print(x[0],x[1],x[2])
Buggy python submission (verdict: Runtime Error):
import sys
cnt = 1
while 1:
	x=sys.stdin.readline().strip()
	if x == '0':
		break;
	print("Case %d: %s"%(cnt,x))
	cnt++ 

Fixed submission:
cnt = 1
while 1:
	x=int(input())
	if x == 0:
		break;
	print("Case %d: %d"%(cnt,x))
	cnt+=1
Buggy python submission (verdict: Runtime Error):

import sys 
while True:
	x,y = map(int,sys.stdin.inputline().split())
	if x==0 & y==0:
		break
	else:
		if x<=y:
			print(x,y)
		else:
			print(y,x)

Fixed submission:
while True:
	x,y=map(int,input().split())
	if (x==0) & (y==0):
		break
	else:
		if x>y:
			print(y,x)
		else:
			print(x,y)
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())

print("%.6f %.6f"%(r*r*math.pi,2*r*math.pi))

Fixed submission:
import math
r = float(input())

print("%.6f %.6f"%(r*r*math.pi,2*r*math.pi))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(0,n):
	x = input()
	l.append(int(x))

print(max(l),min(l),sum(l))

Fixed submission:
input()#??????input()????????????
nums = [int(i) for i in input().split()]
print(min(nums),max(nums),sum(nums))
Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	card.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if not in cards]:
	print(s,r)
	

Fixed submission:
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	cards.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if (s,r) not in cards]:
	print(s,r)

Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	cards.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if not in cards]:
	print(s,r)
	

Fixed submission:
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	cards.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if (s,r) not in cards]:
	print(s,r)
Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
A=[]
b=[]
for i in range(m):
	A.append([int(j) for j in inpur().split()])
for i in range(m):
	b.append(int(input()))
for i in range(n):
	s = 0
	for j in range(m):
		s+=A[i][j]*b[j]
	print(s)

Fixed submission:
a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
A=[]
b=[]
for i in range(m):
	A.append([int(j) for j in input().split()])
for i in range(m):
	b.append(int(input()))
for i in range(n):
	s = 0
	for j in range(m):
		s+=A[i][j]*b[j]
	print(s)

Fixed submission:
a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
A=[]
b=[]

for i in range(m):
	A.append([int(j) for j in input().split()])

for i in range(m):
	b.append(int(input()))

for i in range(n):
	s = 0
	for j in range(m):
		s+=A[i][j]*b[j]
print(s)

Fixed submission:
a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
A=[]
b=[]
s=0
for i in range(m):
	A.append([int(j) for j in input().split()])

for i in range(m):
	b.append(int(input()))

for i in range(n):
	
	for j in range(m):
		s+=A[i][j]*b[j]
print(s)

Fixed submission:
a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)
Buggy python submission (verdict: Runtime Error):

w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    word = line.split().casefold()
    word_count += word.count(w)
print(word_count)

Fixed submission:

w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    word_count += word.count(w)
print(word_count)

Buggy python submission (verdict: Runtime Error):

w = input().casefold()
word_count = 0
while True:
    line = input().casefold()
    if line == "END_OF_TEXT":
        break
    word = line.split()
    word_count += word.count(w)
print(word_count)

Fixed submission:

w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    word_count += word.count(w)
print(word_count)
Buggy python submission (verdict: Runtime Error):
string = input()
n = int(input())

for i in range(n):
	command = input().split()
	c_n = command[0]
	c_i1 = command[1]
	c_i2 = command[2]
	if c_n =='print':
		print(string[c_i1:c_i2])
	elif c_n =='revese':
		string = string[:c_i1]+string[c_i1:c_i2][::-1]+string[c_i2:]
	else:
		string = string[:c_i1] + command[3] + string[c_i2]		

Fixed submission:
string = input()
 
n = int(input())
 
for i in range(n):
    command = input().split()
    c_n = command[0]
    c_i1 = int(command[1])
    c_i2 = int(command[2]) + 1
    if c_n == "print":
        print(string[c_i1:c_i2])
    elif c_n == "reverse":
        string = string[:c_i1] + string[c_i1:c_i2][::-1] + string[c_i2:]
    else:
        string = string[:c_i1] + command[3] + string[c_i2:]
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

hills_list = []
while len(hills_list) != 10:
    hills = raw_input()
    if isinstance(hills, int) and (10000 >= hills) and (hills >= 0):
        hills_list.append(hills)
hills_list.sort()
print hills_list[0]
print hills_list[1]
print hills_list[2]

Fixed submission:
# -*- coding: utf-8 -*-

hills_list = []
while len(hills_list) != 10:
    hills = raw_input()
    if (10000 >= int(hills)) and (int(hills) >= 0):
        hills_list.append(int(hills))
hills_list.sort()
print hills_list[-1]
print hills_list[-2]
print hills_list[-3]