Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def set_pdt(i, p, d):
    u = tree[i]
    u[0], u[1] = p, d
    for c in u[3]:
        set_pdt(c, i, d+1)
    else:
        if u[0] == -1:
            u[2] = "root"
        elif u[3]:
            u[2] = "internal node"
        else:
            u[2] = "leaf"

n = int(input())
#         p d t ch
tree = [[-1,0,0,0] for _ in range(n)]
root = set(range(n))

for _ in range(n):
    i, k, *c = map(int, input().split())
    tree[i][3] = c
    root -= set(c)
    
set_pdt(*root, -1, 0)

for i in range(n):
    u = tree[i]
    print("node {}: parent = {}, depth = {}, {}, {}".format(i, *u))

Fixed submission:
def set_pdt(i, p, d):
    u = tree[i]
    u[0], u[1] = p, d
    for c in u[3]:
        set_pdt(c, i, d+1)
    else:
        if u[0] == -1:
            u[2] = "root"
        elif u[3]:
            u[2] = "internal node"
        else:
            u[2] = "leaf"

n = int(input())
tree = [[-1,0,0,0] for _ in range(n)]
root = set(range(n))

for _ in range(n):
    i, k, *c = map(int, input().split())
    tree[i][3] = c
    root -= set(c)
    
set_pdt(root.pop(), -1, 0)

for i in range(n):
    u = tree[i]
    print("node {}: parent = {}, depth = {}, {}, {}".format(i, *u))

Buggy python submission (verdict: Runtime Error):
def set_pdt(i, p, d):
    u = tree[i]
    u[0], u[1] = p, d
    for c in u[3]:
        set_pdt(c, i, d+1)
    else:
        if u[0] == -1:
            u[2] = "root"
        elif u[3]:
            u[2] = "internal node"
        else:
            u[2] = "leaf"

n = int(input())
#         p d t ch
tree = [[-1,0,0,0] for _ in range(n)]
root = set(range(n))

for _ in range(n):
    i, k, *c = map(int, input().split())
    tree[i][3] = c
    root -= set(c)
    
set_pdt(root[0], -1, 0)

for i in range(n):
    u = tree[i]
    print("node {}: parent = {}, depth = {}, {}, {}".format(i, *u))

Fixed submission:
def set_pdt(i, p, d):
    u = tree[i]
    u[0], u[1] = p, d
    for c in u[3]:
        set_pdt(c, i, d+1)
    else:
        if u[0] == -1:
            u[2] = "root"
        elif u[3]:
            u[2] = "internal node"
        else:
            u[2] = "leaf"

n = int(input())
tree = [[-1,0,0,0] for _ in range(n)]
root = set(range(n))

for _ in range(n):
    i, k, *c = map(int, input().split())
    tree[i][3] = c
    root -= set(c)
    
set_pdt(root.pop(), -1, 0)

for i in range(n):
    u = tree[i]
    print("node {}: parent = {}, depth = {}, {}, {}".format(i, *u))
Buggy python submission (verdict: Runtime Error):
class Dice:
    def __init__(self, f):
        self.f = f
        # f = face := (top, sud, est, west, nord, botm)

    
    dict = {'S' : (4, 0, 2, 3, 5, 1), \
            'E' : (3, 1, 0, 5, 4, 2), \
            'W' : (3, 1, 2, 3, 4, 5), \
            'N' : (1, 5, 2, 3, 0, 4) }
    
    def turn(self, c):
                 # c = command := 'NSEWs'
        for i in range(len(c)):
            f = [f[j] for j in dict[c[i]]]


face = list(map(int, input().strip().split()))
Dice(face).turn(input())
print(face[0])

Fixed submission:
op = {'N':(1,5,2,3,0,4), 'S':(4,0,2,3,5,1), 'E':(3,1,0,5,4,2), 'W':(2,1,5,0,4,3)}
f = input().split()
for i in input():
    f = [f[j] for j in op[i]]
print(f[0])
Buggy python submission (verdict: Runtime Error):
f = input().split()
input()
while True:
    t, s = map(f.index, input().split())
    if t in A and s in A:
        print(f[2]) if A.index(t) - A.index(s) in D else print(f[3])
    if t in B and s in B:
        print(f[0]) if B.index(t) - B.index(s) in D else print(f[5])
    if t in C and s in C:
        print(f[1]) if C.index(t) - C.index(s) in D else print(f[4])

Fixed submission:
R = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f = input().split()

for i in range(int(input())):
    t, s = map(f.index, input().split())
    for j in R:
        if not (t in j)*(s in j):
            continue
        d = R.index(j)
        if (j.index(t) - j.index(s)) %4 == 1:
            d -= 5
    print(f[abs(d)])

Buggy python submission (verdict: Runtime Error):
A,B,C = (0,1,5,4),(1,2,4,3),(2,0,3,5)
D = (-1,3)

f = input().split()
input()
while True:
    t, s = map(f.index, input().split())
    if t in A and s in A:
        print(f[2]) if A.index(t) - A.index(s) in D else print(f[3])
    if t in B and s in B:
        print(f[0]) if B.index(t) - B.index(s) in D else print(f[5])
    if t in C and s in C:
        print(f[1]) if C.index(t) - C.index(s) in D else print(f[4])

Fixed submission:
R = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f = input().split()

for i in range(int(input())):
    t, s = map(f.index, input().split())
    for j in R:
        if not (t in j)*(s in j):
            continue
        d = R.index(j)
        if (j.index(t) - j.index(s)) %4 == 1:
            d -= 5
    print(f[abs(d)])

Buggy python submission (verdict: Runtime Error):
rot = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f = input().split()

for i in range(int(input())):
    t, s = map(f.index, input().split())
    for j in rot:
        if (t in j)*(s in j):
            continue
        d = rot.index(j)
        if (j.index(t) - j.index(s)) %4 == 1:
            d -= 5
    print(f[abs(d)])

Fixed submission:
R = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f = input().split()

for i in range(int(input())):
    t, s = map(f.index, input().split())
    for j in R:
        if not (t in j)*(s in j):
            continue
        d = R.index(j)
        if (j.index(t) - j.index(s)) %4 == 1:
            d -= 5
    print(f[abs(d)])
Buggy python submission (verdict: Runtime Error):
l=[]

for x in ['S','H','C','D']:
    for y in [str(i+1) for i in range(13)]:
        l += [x+' '+y]

for n in range(input()):
  l.remove(input())
for i in l:
  print(i)

Fixed submission:
l = [x+' '+y for x in['S','H','C','D']for y in[str(i+1)for i in range(13)]]
for n in range(int(input())):
  l.remove(input())
for i in l:
  print(i)

Buggy python submission (verdict: Runtime Error):
l=[]

for x in ['S','H','C','D']:
    for y in [str(i+1) for i in range(13)]:
        l += [x+' '+y]

for n in range(int(input()):
  l.remove(input())
for i in l:
  print(i)

Fixed submission:
l = [x+' '+y for x in['S','H','C','D']for y in[str(i+1)for i in range(13)]]
for n in range(int(input())):
  l.remove(input())
for i in l:
  print(i)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, m = map(int, input().strip().split())
a = np.zeros((n,m), dtype = int)
b = np.zeros((m,1), dtype = int)

for i in range(n):
    a[i] = list(map(int, input().strip().split()))
for i in range(m):
    b[i] = int(input())

c = a.dot(b)

for i in range(n):
    print(c[i][0])

Fixed submission:
n, m = map(int, input().strip().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0] for j in range(m)]
c = [[0] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().strip().split()))

for i in range(m):
    b[i] = [int(input())]


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

Buggy python submission (verdict: Runtime Error):
import numpy as np

n, m = map(int, input().strip().split())
a = np.zeros((n,m), dtype = int)
b = np.zeros((m,1), dtype = int)

for i in range(n):
    a[i] = list(map(int, input().strip().split()))
for i in range(m):
    b[i] = int(input())

c = a.dot(b)

for i in range(n):
    print(c[i][0])

Fixed submission:
n, m = map(int, input().strip().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0] for j in range(m)]
c = [[0] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().strip().split()))

for i in range(m):
    b[i] = [int(input())]


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

Buggy python submission (verdict: Runtime Error):
import numpy as np

n, m = map(int, input().strip().split())
a = np.zeros((n,m), dtype = int)
b = np.zeros((m,1), dtype = int)
c = np.zeros((n,1), dtype = int)

for i in range(n):
    a[i] = list(map(int, input().strip().split()))
for i in range(m):
    b[i] = int(input())

c = a.dot(b)

for i in range(n):
    print(c[i][0])

Fixed submission:
n, m = map(int, input().strip().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0] for j in range(m)]
c = [[0] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().strip().split()))

for i in range(m):
    b[i] = [int(input())]


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

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().strip().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0] for j in range(m)]
c = [[0] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().strip().split()))

for i in range(m):
    b[i] = [int(input())]


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

Fixed submission:
n, m = map(int, input().strip().split())
a = [[0 for j in range(m)] for i in range(n)]
b = [[0] for j in range(m)]
c = [[0] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().strip().split()))

for i in range(m):
    b[i] = [int(input())]


for i in range(n):
    for j in range(m):
        c[i][0] += a[i][j]*b[j][0]
    print(c[i][0])
Buggy python submission (verdict: Runtime Error):
s = []
while True:
    n, x = map(int, input().strip().split())
    if n == x == 0:
        break
    c = 0
    for i in range(1,x/3):
        c += max(0, (i+1-x)//2+n)
    s.append(str(c))
print('\n'.join(s))

Fixed submission:
s = []
while True:
    n, x = map(int, input().strip().split())
    if n == x == 0:
        break
    c = 0
    for i in range(1,x//3):
        c += max(0, max(0,(x -3*i -1)//2) - max(0,(x -2*i -1 -n)))
    s.append(str(c))
print('\n'.join(s))
Buggy python submission (verdict: Runtime Error):
r, c = map(int, input().strip().split())
l = [[] for i in range(r)].append([0 for j in range(c+1)])
for i in range(r):
    l[i] = list(map(int, input().strip().split()))
    l[i].append(sum(l[i][0:c]))
    l[r] = [l[r][j] + l[i][j] for j in range(c+1)]
    print(' '.join(map(str,l[i])))
print(' '.join(map(str,l[r])))

Fixed submission:
r, c = map(int, input().strip().split())
l = [[0 for j in range(c+1)] for i in range(r+1)]
for i in range(r):
    l[i] = list(map(int, input().strip().split()))
    l[i].append(sum(l[i][0:c]))
    l[r] = [l[r][j] + l[i][j] for j in range(c+1)]
    print(' '.join(map(str,l[i])))
print(' '.join(map(str,l[r])))
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input(),split())
print(a*b,a*2+b*2)

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

Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
print(x*b,x*2+y*2)

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

in_=sys.argv[1]
with open(in_,"r") as f:
    lis=[]
    for line in f:
        line=line.strip()
        lis.append(line)
        
for i in sorted(lis,reverse=True):
    print(i)
    if i==2:
        break

Fixed submission:
lis=[]
for i in range(10):
  lis.append(int(input()))
 
for i in sorted(lis,reverse=True)[:3]:
  print(i)
Buggy python submission (verdict: Runtime Error):
string = input()
size = len(string)
st = []
for i in range(size):
    st.append(string(size-i))
print(st)


Fixed submission:
string = input()
size = len(string)
st = []
for i in range(size):
    st.append(string[size-i-1])
print(''.join(st))

Buggy python submission (verdict: Runtime Error):
string = input("input data")
size = len(string)
st = []
for i in range(size):
    st.append(string(size-i))
print(st)


Fixed submission:
string = input()
size = len(string)
st = []
for i in range(size):
    st.append(string[size-i-1])
print(''.join(st))
Buggy python submission (verdict: Time Limit Exceeded):
import math

lst = []
while True:
    try:
        a, b = map(int, input().split())
        lst.append(int(math.log(10, a+b))+1)
    except EOFError:
        for i in lst:
            print(i)

Fixed submission:
import math

lst = []
while True:
    try:
        a, b = map(int, input().split())
        lst.append(int(math.log10(a+b))+1)
    except EOFError:
        for i in lst:
            print(i)
        break
Buggy python submission (verdict: Runtime Error):
from numpy import *
ABs=[]
CDs=[]
n = int(input())
for i in range(n):
    x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split())
    AB = array([x_2 - x_1, y_2 - y_1])
    CD = array([x_4 - x_3, y_4 - y_3])
    ABs.append(AB)
    CDs.append(CD)
for i in range(n):
    if linalg.norm(cross(ABs[i],CDs[i]))==0.0:
        print("YES")
    else:
        print("NO")

Fixed submission:
ABs=[]
CDs=[]
n = int(input())
for i in range(n):
    x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split())
    AB = [x_2 - x_1, y_2 - y_1]
    CD = [x_4 - x_3, y_4 - y_3]
    ABs.append(AB)
    CDs.append(CD)
for i in range(n):
    if abs(ABs[i][0]*CDs[i][1]-ABs[i][1]*CDs[i][0])<10**(-10):
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Runtime Error):
from numpy import *
N=int(input())
x_a=[0]*N
y_a=[0]*N
r_a=[0]*N
x_b=[0]*N
y_b=[0]*N
r_b=[0]*N
for i in range(N):
    x_a[i],y_a[i],r_a[i],x_b[i],y_b[i],r_b[i]=map(float,input().split())
for i in range(N):
    a=array([x_a[i]-x_b[i],y_a[i]-y_b[i]])
    AB=linalg.norm(a)
    r_diff=abs(r_a[i]-r_b[i])
    if AB > r_a[i]+r_b[i]:
        print(0)
    elif r_a[i]+r_b[i] >= AB and AB >= r_diff:
        print(1)
    elif r_diff > AB:
        if r_a[i] > r_b[i]:
            print(2)
        else:
            print(-2)

Fixed submission:

N=int(input())
x_a=[0]*N
y_a=[0]*N
r_a=[0]*N
x_b=[0]*N
y_b=[0]*N
r_b=[0]*N
for i in range(N):
    x_a[i],y_a[i],r_a[i],x_b[i],y_b[i],r_b[i]=map(float,input().split())
for i in range(N):
    AB=((x_a[i]-x_b[i])**2+(y_a[i]-y_b[i])**2)**(1/2)
    r_diff=abs(r_a[i]-r_b[i])
    if AB > r_a[i]+r_b[i]:
        print(0)
    elif r_a[i]+r_b[i] >= AB and AB >= r_diff:
        print(1)
    else:
        if r_a[i] > r_b[i]:
            print(2)
        else:
            print(-2)

Buggy python submission (verdict: Runtime Error):
from numpy import *
N=int(input())
x_a=[0]*N
y_a=[0]*N
r_a=[0]*N
x_b=[0]*N
y_b=[0]*N
r_b=[0]*N
for i in range(N):
    x_a[i],y_a[i],r_a[i],x_b[i],y_b[i],r_b[i]=map(float,input().split())
for i in range(N):
    a=array([x_a[i]-x_b[i],y_a[i]-y_b[i]])
    AB=linalg.norm(a)
    r_diff=abs(r_a[i]-r_b[i])
    if AB > r_a[i]+r_b[i]:
        print(0)
    elif r_a[i]+r_b[i] >= AB and AB >= r_diff:
        print(1)
    else:
        if r_a[i] > r_b[i]:
            print(2)
        else:
            print(-2)

Fixed submission:

N=int(input())
x_a=[0]*N
y_a=[0]*N
r_a=[0]*N
x_b=[0]*N
y_b=[0]*N
r_b=[0]*N
for i in range(N):
    x_a[i],y_a[i],r_a[i],x_b[i],y_b[i],r_b[i]=map(float,input().split())
for i in range(N):
    AB=((x_a[i]-x_b[i])**2+(y_a[i]-y_b[i])**2)**(1/2)
    r_diff=abs(r_a[i]-r_b[i])
    if AB > r_a[i]+r_b[i]:
        print(0)
    elif r_a[i]+r_b[i] >= AB and AB >= r_diff:
        print(1)
    else:
        if r_a[i] > r_b[i]:
            print(2)
        else:
            print(-2)
Buggy python submission (verdict: Time Limit Exceeded):
def isPrime(number):
    for i in range(2,number):
        if number%(i)==0:
            return False
    return True
N=int(input())
numbers=[]
for i in range(N):
    numbers.append(int(input()))
    pass
count=0
for number in numbers:
    if isPrime(number):
        count+=1
print(count)

Fixed submission:
import math
def isPrime(number):
    for i in range(2,math.floor(math.sqrt(number))+1):
        if number%(i)==0:
            return False
    return True
N=int(input())
numbers=[]
for i in range(N):
    numbers.append(int(input()))
    pass
count=0
for number in numbers:
    if isPrime(number):
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
x1,y1,x2,y2=map(int,input().split())
dist=math.sqrt((x1-x2)**2+(y1-y2)**2)
print(dist)

Fixed submission:
import math
x1,y1,x2,y2=map(float,input().split())
dist=math.sqrt((x1-x2)**2+(y1-y2)**2)
print(dist)
Buggy python submission (verdict: Runtime Error):
import statistics
data=[]
while True:
    n=eval(input())
    if n==0:break
    data.append(list(map(int,input().split())))
Data=iter(data)
for i in Data:
    print(statistics.stdev(i))

Fixed submission:
import statistics
data=[]
while True:
    n=eval(input())
    if n==0:break
    data.append(list(map(int,input().split())))
Data=iter(data)
for i in Data:
        print(statistics.pstdev(i))
Buggy python submission (verdict: Runtime Error):
n=input()
s=c=h=d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Fixed submission:
n=input()
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
count=0
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Buggy python submission (verdict: Runtime Error):
n=input()
s=c=h=d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Fixed submission:
n=input()
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
count=0
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Buggy python submission (verdict: Runtime Error):
n=input()
s=c=h=d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Fixed submission:
n=input()
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
count=0
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))
Buggy python submission (verdict: Time Limit Exceeded):
def solve(sup,rest,digit,used1,used2):
    if digit==0:
        if rest==0:
            return 1
        else:
            return 0
    sum=0
    for i in range(1,sup+1):
        if i!=used1 and i!=used2:
            if used1==0:
                sum+=solve(sup,rest-i,digit-1,i,used2)
            elif used2==0:
                sum+=solve(sup,rest-i,digit-1,used1,i)
            else:
                sum+=solve(sup,rest-i,digit-1,used1,used2)
    return sum

N=[]
X=[]
while True:
    n,x=map(int,raw_input().split())
    if (n,x)==(0,0):
        break
    N.append(n)
    X.append(x)
for i in range(len(N)):
    print('%d'%(solve(N[i],X[i],3,0,0)/6))

Fixed submission:
def solve(sup,rest,digit,used1,used2):
    if rest<0:
        return 0
    if digit==0:
        if rest==0:
            return 1
        else:
            return 0
    sum=0
    for i in range(1,sup+1):
        if i!=used1 and i!=used2:
            if used1==0:
                sum+=solve(sup,rest-i,digit-1,i,used2)
            elif used2==0:
                sum+=solve(sup,rest-i,digit-1,used1,i)
            else:
                sum+=solve(sup,rest-i,digit-1,used1,used2)
    return sum

N=[]
X=[]
while True:
    n,x=map(int,raw_input().split())
    if (n,x)==(0,0):
        break
    N.append(n)
    X.append(x)
for i in range(len(N)):
    print('%d'%(solve(N[i],X[i],3,0,0)/6))
Buggy python submission (verdict: Runtime Error):
r,c=map(int,raw_input().split())
A=[]
for i in range(r):
    A.append(map(int,raw_input().split()))
    A[i].append(sum(A[i]))
A.append([sum([A[i][j] for i in range(r)]) for j in range(c)])
print(A)
for i in range(r):
    print(' '.join(A[i]))
    

Fixed submission:
r,c=map(int,raw_input().split())
A=[]
for i in range(r):
    A.append(map(int,raw_input().split()))
    A[i].append(sum(A[i]))
A.append([sum([A[i][j] for i in range(r)]) for j in range(c+1)])
for i in range(r+1):
    print(' '.join(map(str,A[i])))
Buggy python submission (verdict: Runtime Error):
sen=raw_input()
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
g=[]
h=[]
i=[]
j=[]
k=[]
l=[]
m=[]
n=[]
o=[]
p=[]
q=[]
r=[]
s=[]
t=[]
u=[]
v=[]
x=[]
y=[]
z=[]
w=[]
count={'a':a,'b':b,'c':c,'d':d,'e':e,'f':f,'g':g,'h':h,'i':i,'j':j,'k':k,'l':l,'m':m,'n':n,'o':o,'p':p,'q':q,'r':r,'s':s,'t':t,'u':u,'v':v,'w':w,'x':x,'y':y,'z':z}
for i in range(len(sen)):
    if sen[i].isalpha():
        count[sen[i].lower()].append('#')
for char in [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]:
    print('%s:%d'%(char,len(count[char])))

Fixed submission:
import sys
sen=[]
for line in sys.stdin:
    sen.append(line)
Sen=''.join(sen)

a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
g=[]
h=[]
i=[]
j=[]
k=[]
l=[]
m=[]
n=[]
o=[]
p=[]
q=[]
r=[]
s=[]
t=[]
u=[]
v=[]
x=[]
y=[]
z=[]
w=[]
count={'a':a,'b':b,'c':c,'d':d,'e':e,'f':f,'g':g,'h':h,'i':i,'j':j,'k':k,'l':l,'m':m,'n':n,'o':o,'p':p,'q':q,'r':r,'s':s,'t':t,'u':u,'v':v,'w':w,'x':x,'y':y,'z':z}
for i in range(len(Sen)):
    if Sen[i].isalpha():
        count[Sen[i].lower()].append('#')
for char in sorted(count.keys()):
    print('%s : %d'%(char,len(count[char])))
Buggy python submission (verdict: Runtime Error):
W=raw_input()
Text=[]
while True:
    text=raw_input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
print('%d'%Text.count(W))

Fixed submission:
w=input()
W=w.lower()
Text=[]
while True:
    text=input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

Buggy python submission (verdict: Runtime Error):
w=raw_input()
W=w.lower()
Text=[]
while True:
    text=raw_input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

Fixed submission:
w=input()
W=w.lower()
Text=[]
while True:
    text=input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))
Buggy python submission (verdict: Runtime Error):
m = input()
n = input()
i = 0
j = 0
list = []
while i < m:
    while j < n:
        k = input()
        list.append(k)
        j += 1
    i += 1
i = 0
list2 = []
while i < n:
    k = input()
    list2.append(k)
    i += 1
i = 0
j = 0
k = 0
while i < m:
    while j < n:
        t = list[j + k]
        s = list2[j]
        sum += t * s
        j += 1
    print(sum)
    i += 1
    k += 4

Fixed submission:
a1 = [input().split()]
m = int(a1[0][0])
n = int(a1[0][1])
a2 = [input().split() for i in range(m)]
a3 = [input().split() for i in range(n)]
i = 0
while i < m:
    sum = 0
    j = 0
    while j < n:
        s = int(a2[i][j]) * int(a3[j][0])
        sum += s
        j += 1
    print(sum)
    i += 1
Buggy python submission (verdict: Runtime Error):
[print"%dx%d=%d"%(i,j,i*j)for i in range(1, 10)for j in range(1, 10)]

Fixed submission:
x=range(1,10);[print("%dx%d=%d"%(i,j,i*j))for i in x for j in x]
Buggy python submission (verdict: Runtime Error):
n,m,r=map(int,input().split())
r-=n*m
if r<0:print(0);exit(0);
from math import *
print(int(factorial(n+r-1)/factorial(r)/factorial(n-1)))

Fixed submission:
n,m,r=map(int,input().split())
r-=n*m
if r<0:print(0);exit(0);
from math import *
print(factorial(n+r-1)//factorial(r)//factorial(n-1))