Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)*(ax - bx) + (ay * by)
    if d < abs(br - ar):
        if ar > br:
            print(2)
        else:
            print(-2)
    elif d <= r1 + r2:
        print(1)
    else:
        print(0)

Fixed submission:


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)*(ax - bx) + (ay * by)(ay * by)
    if d < abs(br - ar):
        if ar > br:
            print(2)
        else:
            print(-2)
    elif d <= ar + br:
        print(1)
    else:
        print(0)

Fixed submission:


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(n):
    a,b,c = map(int, input().split())
    if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
            print("YES")
        else:
            print("NO")

Fixed submission:
n = int(input())
for i in range(0, n):
    a,b,c = map(int, input().split())
    if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
        print("YES")
    else:
        print("NO")

Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(0, n):
    a,b,c = map(int, input().split())
    if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
        print("YES")
    else:
        print("NO")

Fixed submission:
n = int(input())
for i in range(0, n):
    a,b,c = map(int, input().split())
    if a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a:
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
result = 100000
for i in range(0,n):
    result = result * 1.05
    if result % 1000 == 0:
        pass
    else:
        result = result-(result % 1000)+ 1000
        result = result(int)
print(result)

Fixed submission:
n = int(input())
result = 100000
for i in range(0,n):
    result = result * 1.05
    if result % 1000 == 0:
        pass
    else:
        result = result-(result % 1000)+ 1000
        result = int(result)
print(result)
Buggy python submission (verdict: Runtime Error):
try:
    while True:
        result = result2 = count = 0
        a, b = map(int, input().split(','))
        result += a*b
        result2 += b
        count += 1
except:
    print(result,"{0:.1f}".format(result2/count))

Fixed submission:
try:
    result = result2 = count = 0
    while True:
        a, b = map(int, input().split(','))
        result += a*b
        result2 += b
        count += 1
except:
    print(result)
    print(round(result2/count+0.5))

Buggy python submission (verdict: Runtime Error):
try:
    result = result2 = count = 0
    while True:
        a, b = map(int, input().split(','))
        result += a*b
        result2 += b
        count += 1
except:
    print(result)
    print((round(result2/count+0.5))

Fixed submission:
try:
    result = result2 = count = 0
    while True:
        a, b = map(int, input().split(','))
        result += a*b
        result2 += b
        count += 1
except:
    print(result)
    print(round(result2/count+0.5))
Buggy python submission (verdict: Runtime Error):
import re
try:
    ls = num = []
    result = 0
    while True:
        ls.append(input())
except:
    for i in ls:
        for s in range(re.findall(r'\d+', i)):
            result += int(s)
    print(result)

Fixed submission:
import re
try:
    result = 0
    while True:
        for s in re.findall(r'\d+', input()):
            result += int(s)
except:
    print(result)
Buggy python submission (verdict: Runtime Error):
ls = list(map(int, input().split()))
ls.sort()
if ls[0]==ls[1]==ls[2]==ls[3] and ls[4==ls[5]==ls[6]==ls[7] and ls[8]==ls[9]==ls[10]==ls[11]:
    print('yes')
else:
    print('no')

Fixed submission:
ls = list(map(int, input().split()))
ls.sort()
if ls[0]==ls[1]==ls[2]==ls[3] and ls[4]==ls[5]==ls[6]==ls[7] and ls[8]==ls[9]==ls[10]==ls[11]:
    print('yes')
else:
    print('no')
Buggy python submission (verdict: Runtime Error):
import math
x, y = map(int,input().split())
print(math.gcd(x, y))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a%b
	return a
x, y = map(int,input().split())
print(gcd(x, y))
Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input().split()
input()
T = input().split()
count = 0
for t in T:
    if t in S:
        count += 1
print(count)

Fixed submission:
input()
S = set(input().split())
input()
T = set(input().split())
count = 0
for t in T:
    if t in S:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
ls = []
for i in range(int(input())):
    command, text = input().split()
    if command == "insert":
        ls.append(text)

    else:
        if ls.count(text) >= 1:
            print("yes")
        else:
            print("no")

Fixed submission:
dic = {}
line = []
for i in range(int(input())):
    line.append(input().split())
for i in line:
    if i[0][0] == "i":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")

Buggy python submission (verdict: Time Limit Exceeded):
ls = []
for i in range(int(input())):
    command, text = input().split()
    if command == "insert":
        ls.append(text)
    else:
        print("yes" if text in ls else "no")

Fixed submission:
dic = {}
line = []
for i in range(int(input())):
    line.append(input().split())
for i in line:
    if i[0][0] == "i":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")

Buggy python submission (verdict: Runtime Error):
import sys
ls = []
line = map(lambda x:x.split(), sys.stdin.readlines())
for i in line:
    if i[0] == "insert":
        ls.append(i[1])
    else:
        print("yes" if i[1] in ls else "no")

Fixed submission:
dic = {}
line = []
for i in range(int(input())):
    line.append(input().split())
for i in line:
    if i[0][0] == "i":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input()
ls = []
line = map(lambda x:x.split(), sys.stdin.readlines())
for i in line:
    if i[0] == "insert":
        ls.append(i[1])
    else:
        print("yes" if i[1] in ls else "no")

Fixed submission:
dic = {}
line = []
for i in range(int(input())):
    line.append(input().split())
for i in line:
    if i[0][0] == "i":
        dic[i[1]] = None
    else:
        print("yes" if i[1] in dic else "no")
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
x = x2 - x1
y = y2 - y1
result = x**2 + y**2
print(math.sqrt(result))

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
x = x2 - x1
y = y2 - y1

result = x**2 + y**2
print(math.sqrt(result))
Buggy python submission (verdict: Runtime Error):
import statistics
while True:
    x = input()
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print(statistics.pstdev(ls))

Fixed submission:
import statistics
while True:
    x = int(input())
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print("{0:.8f}".format(statistics.pstdev(ls)))

Buggy python submission (verdict: Runtime Error):
import statistics
while True:
    x = input()
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print("{0:.8f}".format(statistics.pstdev(ls)))

Fixed submission:
import statistics
while True:
    x = int(input())
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print("{0:.8f}".format(statistics.pstdev(ls)))
Buggy python submission (verdict: Runtime Error):
print(int(input(x???????????\?????????????????????))**3)

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
import re

t = re.search(r"(\d{1,3})\s(\d{1,3})", input(""))

a = t.group(1)
b = t.group(2)

x = a * b
y = a*2 + b*2

print(x,y)

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

Buggy python submission (verdict: Runtime Error):
x = input("")
x2 = x.split()
result = x2[0] * x2[1]
result2= x2[0]*2 + x2[1]*2
print(result,result2)

Fixed submission:
a, b =map(int, input().split())
print(a*b,2*(a+b))
Buggy python submission (verdict: Runtime Error):
time = input("")
h = time // 3600
h2 = time % 3600
m = h2 // 60
m2 = h2 % 60
s = m2

print(h+:+m+:+s)

Fixed submission:
S = int(input())
h = S//3600
m = (S%3600) // 60
s = (S%3600)%60
h = str(h)
m= str(m)
s = str(s)
print(h+":"+m+":"+s)
Buggy python submission (verdict: Runtime Error):
import re

given = input("")

result = re.search(r"([0-9]+)\s([0-9]+)", given)

a = int(result.group(1))
b = int(result.group(2))

if a == b:
    print(a, ==, b)

elif a < b:
    print(a, <, b)

else:
    print(a, >, b)

Fixed submission:
a, b = map(int, input().split())
if a<b:
    print("a < b")

elif a>b:
    print("a > b")

else:
    print("a == b")
Buggy python submission (verdict: Runtime Error):
count = 0
while True:
    x=input("")
    count+=1
    print("Case ",str(count) + ":", x)

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
count = 0
while True:
    x=input("")
    count+=1
    print("Case",str(count) + ":", x)

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
count = 0
x=None
while (x == 0) == False:
    x=input("")
    int(count)
    count+=1
    print("Case",str(count)+":", x)

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
x = input("")
count=1
while x != 0:
    print("Case",str(count)+":",x)
    count = int(count) + 1
    x = input("")

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
x = input("")
count = 1
while True:
    print("Case",str(count)+":",input(""))
    count = int(count) + 1
    if x == 0:
        break

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
count = 1
while True:
    print("Case",str(count)+":",input(""))
    count = int(count) + 1
    if x == 0:
        break

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
count = 1
while True:
    x = input("")
    print("Case",str(count)+":",x)
    count = int(count) + 1
    if x == 0:
        break

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)

Buggy python submission (verdict: Runtime Error):
count = 1
t=[]
while True:
    x = input("")
    if x == "0":
        break
    else:
        t.append("Case",str(count)+":",x)
        count = int(count) + 1

for i in t:
    print(t[i])

Fixed submission:
t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)
Buggy python submission (verdict: Runtime Error):
list1=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        list1.append(x)

for i,v in enumerate(list1):
    x,y = map(int,v.split())
    if x < y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))

Fixed submission:
list1=[]
while True:
    x = input("")
    if x == "0 0":
        break
    else:
        list1.append(x)

for i,v in enumerate(list1):
    x,y = map(int,v.split())
    if x <= y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
for i in range(a, b):
    if i % c == 0:
        result += str(c)+" "
print(result)

Fixed submission:
a, b, c = map(int, input().split())
result = 0
for i in range(a, b+1):
    if c % i == 0:
        result += 1
print(result)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
d = a // b
r = a % b
f = a / b
print(d,r,{0:.5f}.format)

Fixed submission:
a, b = map(int, input().split())
d = a // b
r = a % b
f = a / b
print(d,r,"{0:.5f}".format(f))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
d = a // b
r = a % b
f = a / b
print(d,r,"{0:.5f}".format)(f)

Fixed submission:
a, b = map(int, input().split())
d = a // b
r = a % b
f = a / b
print(d,r,"{0:.5f}".format(f))
Buggy python submission (verdict: Runtime Error):
import math
r = input()
S = r * r * math.pi
l = 2 * math.pi * r

print("{0:.5f}".format(S),"{0:.5f}".format(l))

Fixed submission:
import math
r = float(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f} {1:.5f}".format(S, l))

Buggy python submission (verdict: Runtime Error):
import math
r = input()
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f}".format(S, l))

Fixed submission:
import math
r = float(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f} {1:.5f}".format(S, l))

Buggy python submission (verdict: Runtime Error):
import math
r = int(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f}".format(S, l))

Fixed submission:
import math
r = float(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f} {1:.5f}".format(S, l))

Buggy python submission (verdict: Runtime Error):
from math import pi
r=int(input())
print(r*r*pi,2*r*pi)

Fixed submission:
import math
r = float(input(""))
S = r * r * math.pi
l = 2 * math.pi * r
print("{0:.5f} {1:.5f}".format(S, l))
Buggy python submission (verdict: Runtime Error):
input()
x = [map(int, input().split(' '))]
print(min(x)),max(x),sum(x))

Fixed submission:
input()
x = list(map(int,input().split()))
print(min(x),max(x),sum(x))

Buggy python submission (verdict: Runtime Error):
input()
x = [map(int, input().split(''))]
print(min(x),max(x),sum(x))

Fixed submission:
input()
x = list(map(int,input().split()))
print(min(x),max(x),sum(x))
Buggy python submission (verdict: Runtime Error):
input("")
print(3 6 9 12 13 15 18 21 23 24 27 30)

Fixed submission:
n = int(input())
result = ""
for s in range(1, n+1):
    if s % 3 == 0:
        result += " "+str(s)
    else:
        for i in str(s):
            if i == "3":
                result += " "+str(s)
                break
print(result)
Buggy python submission (verdict: Runtime Error):
swapcase(input())

Fixed submission:
print(input().swapcase())
Buggy python submission (verdict: Runtime Error):
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        for i in x:
            result += int(x[i])
            list1.append(result)
sum(list1)

Fixed submission:
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        result=0
        for i in x:
            result += int(i)
        list1.append(result)
            
for i in list1:
    print(i)

Buggy python submission (verdict: Runtime Error):
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        for i in x:
            result += int(i)
            list1.append(result)
sum(list1)

Fixed submission:
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        result=0
        for i in x:
            result += int(i)
        list1.append(result)
            
for i in list1:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
isPrime = []

def init():
    for i in range(50000 + 1):
        isPrime.append(True)

def eratos():
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, 50000 + 1):
        for j in range(i * 2, 50000 + 1, i):
            isPrime[j] = False

init()
eratos()
while True:
    n = int(input())
    if n == 0:
        break
    
    count = 0
    for i in range(2, n // 2 + 1):
        if isPrime[i] & isPrime[n - i]:
            count += 1

    print(count)

Fixed submission:
isPrime = []
prime = []
count = []

def init():
    for i in range(50000 + 1):
        isPrime.append(True)
        count.append(0)

def eratos():
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, int((50000 ** (1 / 2))) + 1):
        if (isPrime[i]):
            for j in range(i * 2, 50000 + 1, i):
                isPrime[j] = False
    
    for i in range(2, 50001):
        if isPrime[i]:
            prime.append(i)


def table():
    for i in prime:
        for j in prime:
            if i < j:
                continue
            if i + j > 50000:
                continue
            count[i + j] += 1

init()
eratos()
table()

while True:
    n = int(input())
    if n == 0:
        break
    print(count[n])

Buggy python submission (verdict: Time Limit Exceeded):
isPrime = []
prime = []

import math

def init():
    for i in range(50000 + 1):
        isPrime.append(True)

def eratos():
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, int(math.sqrt(50000)) + 1):
        if (isPrime[i]):
            for j in range(i * 2, 50000 + 1, i):
                isPrime[j] = False
    
    for i in range(2, 50001):
        if isPrime[i]:
            prime.append(i)

init()
eratos()

while True:
    n = int(input())
    if n == 0:
        break

    count = 0
    if n % 2:
        if isPrime[n - 2]:
            count += 1
    else:
        if n == 4:
            count += 1
        else:
            for i in prime:
                if i > (n // 2):
                    break
                if (n - i) in prime:
                    count += 1
    
    print(count)

Fixed submission:
isPrime = []
prime = []
count = []

def init():
    for i in range(50000 + 1):
        isPrime.append(True)
        count.append(0)

def eratos():
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, int((50000 ** (1 / 2))) + 1):
        if (isPrime[i]):
            for j in range(i * 2, 50000 + 1, i):
                isPrime[j] = False
    
    for i in range(2, 50001):
        if isPrime[i]:
            prime.append(i)


def table():
    for i in prime:
        for j in prime:
            if i < j:
                continue
            if i + j > 50000:
                continue
            count[i + j] += 1

init()
eratos()
table()

while True:
    n = int(input())
    if n == 0:
        break
    print(count[n])
Buggy python submission (verdict: Runtime Error):
x = raw_input()
x = x**3
print x

Fixed submission:
x=input()
x=x**3
print x
Buggy python submission (verdict: Runtime Error):
function Main(input) {
    for(i=1;i<10;i++){
	for(j=1;j<10;j++){
	    console.log("%dx%d=%d",i,j,i*j);
	}
    }
}
//input
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Fixed submission:
for i in xrange(81):print "{}x{}={}".format(i/9+1,i%9+1,(i/9+1)*(i%9+1))

Buggy python submission (verdict: Runtime Error):
for(i=1;i<10;i++){
    for(j=1;j<10;j++){
	console.log("%dx%d=%d",i,j,i*j);
    }
}

Fixed submission:
for i in xrange(81):print "{}x{}={}".format(i/9+1,i%9+1,(i/9+1)*(i%9+1))
Buggy python submission (verdict: Runtime Error):
import sys
n=10**5
s=[True]*n
s[0]=False
s[1]=False
for x in xrange(2, int(n**0.5)+1):
    if s[x]:
        for i in xrange(x+x,n,x):
            s[i]=False
for x in sys.stdin.readlines():
    x=int(x)
    cnt=0
    for i in xrange(x):
        if s[i]:
            cnt=cnt+1
    print cnt

Fixed submission:
import sys
n=10**6
p=[1]*n
p[0],p[1]=0,0
for i in xrange(2,int(n**0.5)+1):
    if p[i]==1:
        for j in xrange(i**2,n,i):
            p[j]=0
for i in xrange(2,n):
    p[i]+=p[i-1]
for line in sys.stdin.readlines():
    print p[int(line)]

Buggy python submission (verdict: Runtime Error):
import sys
n=10**5
s=[True]*n
s[0]=False
s[1]=False
for x in xrange(2, int(n**0.5)+1):
    if s[x]:
        for i in xrange(x+x,n,x):
            s[i]=False
for x in sys.stdin.readlines():
    a=int(x)
    cnt=0
    for i in xrange(a):
        if s[i]:
            cnt=cnt+1
    print cnt

Fixed submission:
import sys
n=10**6
p=[1]*n
p[0],p[1]=0,0
for i in xrange(2,int(n**0.5)+1):
    if p[i]==1:
        for j in xrange(i**2,n,i):
            p[j]=0
for i in xrange(2,n):
    p[i]+=p[i-1]
for line in sys.stdin.readlines():
    print p[int(line)]

Buggy python submission (verdict: Runtime Error):
import sys
n=10**5+1
s=[True]*n
s[0]=False
s[1]=False
for x in xrange(2, int(n**0.5)+1):
    if s[x]:
        for i in xrange(x+x,n,x):
            s[i]=False
for x in sys.stdin.readlines():
    a=int(x)
    cnt=0
    for i in xrange(a):
        if s[i]:
            cnt=cnt+1
    print cnt

Fixed submission:
import sys
n=10**6
p=[1]*n
p[0],p[1]=0,0
for i in xrange(2,int(n**0.5)+1):
    if p[i]==1:
        for j in xrange(i**2,n,i):
            p[j]=0
for i in xrange(2,n):
    p[i]+=p[i-1]
for line in sys.stdin.readlines():
    print p[int(line)]

Buggy python submission (verdict: Runtime Error):
import sys
n=10**5
p=[1]*n
p[0],p[1]=0,0
for i in xrange(2,int(n**0.5)+1):
    if p[i]==1:
        for j in xrange(i**2,n,i):
            p[j]=0
for i in xrange(2,n):
    p[i]+=p[i-1]
for line in sys.stdin.readlines():
    print p[int(line)]

Fixed submission:
import sys
n=10**6
p=[1]*n
p[0],p[1]=0,0
for i in xrange(2,int(n**0.5)+1):
    if p[i]==1:
        for j in xrange(i**2,n,i):
            p[j]=0
for i in xrange(2,n):
    p[i]+=p[i-1]
for line in sys.stdin.readlines():
    print p[int(line)]
Buggy python submission (verdict: Runtime Error):
import sys
stack=[]
for i in sys.stdin:
    a=int(i)
    if a >0 :
        stack.append(a)
    else :
        print stack.pop()

Fixed submission:
import sys
stack=[]
for i in sys.stdin:
    try:
        a=int(i)
        if a >0 :
            stack.append(a)
        else :
            print stack.pop()
    except:
        pass

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
stack=[]
for i in sys.stdin:
    a=int(i.split('\n')[0])
    if a >0 :
        stack.append(a)
    else :
        print stack.pop()

Fixed submission:
import sys
stack=[]
for i in sys.stdin:
    try:
        a=int(i)
        if a >0 :
            stack.append(a)
        else :
            print stack.pop()
    except:
        pass
Buggy python submission (verdict: Runtime Error):
while True:
    a=map(int,raw_input().split())
    if not a:break
    b=map(int,raw_input().split())
    hit,blow=0,0
    for i in range(4):
        if a[i]==b[i]:hit+=1
        if a[i] in b :blow+=1
    print hit,blow-hit

Fixed submission:
import sys
line=sys.stdin.readlines()
for A,B in zip(line[0::2],line[1::2]):
    a=map(int,A.strip().split())
    b=map(int,B.strip().split())
    hit,blow=0,0
    for i in xrange(4):
        if a[i]==b[i]:hit+=1
        elif a[i] in b : blow+=1
    print hit,blow