Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
x1=[int(i)for i in input().split()]
x2=[int(i)for i in input().split()]
for i in range(6):
    if x2[i]==x1[0]:
        if x2[5-i]==x1[5]:
            count=i
            break
if x2[count]==x1[0] and x2[5-count]==x1[5]:
    if count==0 or count==5:
        if count==5:
            for i in range(2):
                x2[1],x2[0]=x2[0],x2[1]
                x2[5],x2[1]=x2[1],x2[5]
                x2[4],x2[5]=x2[5],x2[4]
    else:
        if count==1 or count==4:
            while x1[0]!=x2[0]:
                x2[1],x2[0]=x2[0],x2[1]
                x2[5],x2[1]=x2[1],x2[5]
                x2[4],x2[5]=x2[5],x2[4]
        else:
            while x1[0]!=x2[0]:
                x2[3],x2[0]=x2[0],x2[3]
                x2[5],x2[3]=x2[3],x2[5]
                x2[2],x2[5]=x2[5],x2[2]
    for i in range(4):
        if x2[2]==x1[2] and x2[3]==x1[3] and x2[4]==x1[4] and x2[1]==x1[1] :
            print('Yes')
            break
        else:
            x2[1],x2[2]=x2[2],x2[1]
            x2[2],x2[4]=x2[4],x2[2]
            x2[4],x2[3]=x2[3],x2[4]
        if i==3:
            print('No')
else:
    print("No")

Fixed submission:
import sys
x1=[int(i)for i in input().split()]
x2=[int(i)for i in input().split()]
for i in range(6):
    if x2[i]==x1[0]:
        count=i
        if x2[5-i]==x1[5]:
            break
if x2[count]==x1[0] and x2[5-count]==x1[5]:
    if count==0 or count==5:
        if count==5:
            for i in range(2):
                x2[1],x2[0]=x2[0],x2[1]
                x2[5],x2[1]=x2[1],x2[5]
                x2[4],x2[5]=x2[5],x2[4]
    else:
        if count==1 or count==4:
            while x1[0]!=x2[0] or x1[5]!=x2[5]:
                x2[1],x2[0]=x2[0],x2[1]
                x2[5],x2[1]=x2[1],x2[5]
                x2[4],x2[5]=x2[5],x2[4]
        else:
            while x1[0]!=x2[0] or x1[5]!=x2[5]:
                x2[3],x2[0]=x2[0],x2[3]
                x2[5],x2[3]=x2[3],x2[5]
                x2[2],x2[5]=x2[5],x2[2]
    for i in range(4):
        if x2[2]==x1[2] and x2[3]==x1[3] and x2[4]==x1[4] and x2[1]==x1[1] :
            print('Yes')
            break
        else:
            x2[1],x2[2]=x2[2],x2[1]
            x2[2],x2[4]=x2[4],x2[2]
            x2[4],x2[3]=x2[3],x2[4]
        if i==3:
            print('No')
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x=input()
print("%d" % x*x*x)

Fixed submission:
x=int(input())
y=x*x*x
print(y)
Buggy python submission (verdict: Runtime Error):
x=int(input())
y=int(input())
s=x*y
l=2*x+2*y
print(s," ",l)

Fixed submission:
x,y=[int(i) for i in input().split()]
s=x*y
l=2*x+2*y
print(s,l)

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

Fixed submission:
x,y=[int(i) for i in input().split()]
s=x*y
l=2*x+2*y
print(s,l)

Buggy python submission (verdict: Runtime Error):
x=int(input().split())
s=x[0]*x[1]
l=2*x[0]+2*x[1]
print("{0} {1}",format(x[0],x[1]))

Fixed submission:
x,y=[int(i) for i in input().split()]
s=x*y
l=2*x+2*y
print(s,l)
Buggy python submission (verdict: Runtime Error):
for i in range(3000):
    x,y=[int(s) for s in input().split()]
    if x>y:
        print("{0} {1}".format(y,x))
    elif x<=y:
        print("{0} {1}".format(x,y))
    elif x==0 and y==0:
        break

Fixed submission:
for i in range(3000):
    x,y=[int(s) for s in input().split()]
    if x==0 and y==0:
        break
    elif x<=y:
        print("{0} {1}".format(x,y))
    else :
        print("{0} {1}".format(y,x))
Buggy python submission (verdict: Runtime Error):
n,m,l=[int(i) for i in input().split()]
x=[[int(0) for i in range(m)]for j in range(n)]
z=[[int(0) for i in range(l)]for j in range(n)]
y=[[int(0)for i in range(n)]for j in range(m)]
for i in range(n):
    k=input().split()
    for j in range(m):
        x[i][j]=int(k[j])
for i in  range(m):
    k=input().split()
    for j in range(n):
        y[i][j]=int(k[j])
        
for i in range(n):
    for j in range(l):
        count=int(0)
        for v in range(m):
            count=count+x[i][v]*y[v][j]
        z[i][j]=count
for i in range(n):
    for j in range(n-1):
        print(z[i][j],"",end="")
    print(z[i][n-1])

Fixed submission:
n,m,l=[int(i) for i in input().split()]
x=[[int(0) for i in range(m)]for j in range(n)]
z=[[int(0) for i in range(l)]for j in range(n)]
y=[[int(0)for i in range(l)]for j in range(m)]
for i in range(n):
    k=input().split()
    for j in range(m):
        x[i][j]=int(k[j])
for i in  range(m):
    k=input().split()
    for j in range(l):
        y[i][j]=int(k[j])
        
for i in range(n):
    for j in range(l):
        count=int(0)
        for v in range(m):
            count=count+x[i][v]*y[v][j]
        z[i][j]=count
        
for i in range(n):
    for j in range(l-1):
        print(z[i][j],"",end="")
    print(z[i][l-1])
Buggy python submission (verdict: Runtime Error):
while 1:
    x=[ int(i) for i in input()]
    if x==0:
        break
    print(sum(list(x)))

Fixed submission:
while 1:
    x=[int(i) for i in input()]
    if sum(x)==0:
        break
    print(sum(x))
Buggy python submission (verdict: Runtime Error):
x=[i for i in input()]
y=[i for i in range(len(x))]
y=x.copy()
n=int(input())
for i in range(n):
    c=[j for j in input().split()]
    if len(c)==4:
        for j in range(len(c[3])):
            y[j+int(c[1])]=list(c[3])[j]
        x=y.copy()
    elif c[0]=="print":
        for j in range(int(c[1]),int(c[2])+1):
            print(x[j],end="")
        print()
    else:
        for j in range(int(c[1]),int(c[2])):
            y[int(c[2])-j]=x[int(c[1])+j]
        x=y.copy()

Fixed submission:
x=[i for i in input()]
y=[i for i in range(len(x))]
y=x.copy()
n=int(input())
for i in range(n):
    c=[j for j in input().split()]
    if len(c)==4:
        for j in range(len(c[3])):
            y[j+int(c[1])]=list(c[3])[j]
        x=y.copy()
    elif c[0]=="print":
        for j in range(int(c[1]),int(c[2])+1):
            print(x[j],end="")
        print()
    else:
        for j in range(int(c[2])+1-int(c[1])):
            z=[i for i in range(len(x))]
            z=x.copy()
            y[int(c[2])-j]=z[int(c[1])+j]
        x=y.copy()
Buggy python submission (verdict: Runtime Error):
i = 1
n = int(input())
while i <= n:
	if i % 3 == 0:
		print(i , end = ' ')
	elif i % 10 == 3:
		print(i , end = ' ')
	i = i + 1

Fixed submission:
i = 1
n = int(input())
while i <= n:
	x = i
	if x % 3 == 0:
		print('' , i , end = '')
	else:
		while x:
	 		if x % 10 == 3:
	 			print('' , i , end = '')
	 			break
	 		x = int(x / 10)
	i = i + 1
print('')
Buggy python submission (verdict: Runtime Error):
m_h=[int(input(I) for i in range(10)

m_h.sort(reverse=True)

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

Fixed submission:
m_h=[int(input()) for i in range(10)]

m_h.sort(reverse=True)

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

Buggy python submission (verdict: Runtime Error):
m_h=[int(input(I) for i in range(10)]

m_h.sort(reverse=True)

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

Fixed submission:
m_h=[int(input()) for i in range(10)]

m_h.sort(reverse=True)

print(m_h[0])
print(m_h[1])
print(m_h[2])
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

for line in sys.stdin:
    a11,a12,b1,a21,a22,b2 = list(map(int, line.split()))

    A=np.array([[a11,a12],[a21,a22]])
    B=np.array([b1,b2])

    x,y=np.linalg.solve(A,B)
    
    print("{0:.3f} {1:.3f}".format(x,y))

Fixed submission:
import sys

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,line.split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x+0.0,y+0.0))

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

for line in sys.stdin:
    a11,a12,b1,a21,a22,b2 = list(map(int, line.split()))

    A=np.array([[a11,a12],[a21,a22]])
    B=np.array([b1,b2])

    x,y=np.linalg.solve(A,B)
    
    print("{0:.3f} {1:.3f}".format(x,y))

Fixed submission:
import sys

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,line.split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x+0.0,y+0.0))

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

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,input().split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x,y))

Fixed submission:
import sys

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,line.split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x+0.0,y+0.0))

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

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,input().split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x,y))

Fixed submission:
import sys

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,line.split()))
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    print("{0:.3f} {1:.3f}".format(x+0.0,y+0.0))
Buggy python submission (verdict: Time Limit Exceeded):
XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=0
for d in range(1,y+1):
    if y%d==0 and x_dy%d==0:
        ans=d

print(ans)

Fixed submission:
def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))

Buggy python submission (verdict: Runtime Error):
XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=0

if x==y:
    ans=x

for d in range(1,(y+1)//2):
    if y%d==0 and x_dy%d==0:
        ans=d

print(and)

Fixed submission:
def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))

Buggy python submission (verdict: Time Limit Exceeded):
XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=0
if x==y:
    ans=x
else:
    for d in range(1,(y+1)//2):
        if y%d==0 and x_dy%d==0:
            ans=d

print(ans)

Fixed submission:
def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))

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

XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=math.gcb(x,x_dy)

print(ans)

Fixed submission:
def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))

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

XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=math.gcd(x,x_dy)

print(ans)

Fixed submission:
def euclidean_alg(x,y):
    while y:
        x,y=y,x%y
    return x

XY=list(map(int,input().split()))
x=max(XY)
y=min(XY)

print(euclidean_alg(x,y))
Buggy python submission (verdict: Runtime Error):
def insertionSort(a,n,g):
    for i in range(g,n):
        v=a[i]
        j=i-g
        while j>=0 and a[j]>v:
            a[j+g]=a[j]
            j=j-g
            global cnt
            cnt+=1
        a[j+g]=v

def shellsort(a,n):
   # global cnt
    cnt=0
    g=[(3**i-1)//2  for i in range(n,0,-1) if (3**i-1)//2<n]
    m=len(g)
    #print(g,m)
    for i in range(m):
        insertionSort(a,n,g[i])
    return a,m,g

a,m,g=shellsort(a,n)
print(m)
print(*g)
for i in a:
    print(i)

Fixed submission:
def insertionSort(a,n,g):
    for i in range(g,n):
        v=a[i]
        j=i-g
        while j>=0 and a[j]>v:
            a[j+g]=a[j]
            j=j-g
            global cnt
            cnt+=1
        a[j+g]=v

def shellsort(a,n):
    global cnt
    cnt=0
    g=[i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1] if i <= n]
    m=len(g)
    #print(g,m)
    for i in range(m):
        insertionSort(a,n,g[i])
    return a,m,g

n=int(input())
a=[int(input()) for i in range(n)]

a,m,g=shellsort(a,n)

print(m)
print(*g)
print(cnt)
for i in a:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
def insertionSort(a,n,g):
    for i in range(g,n):
        v=a[i]
        j=i-g
        while j>=0 and a[j]>v:
            a[j+g]=a[j]
            j=j-g
            global cnt
            cnt+=1
        a[j+g]=v

def shellsort(a,n):
    global cnt
    cnt=0
    g=[(3**i-1)//2  for i in range(n,0,-1) if (3**i-1)//2<n or (3**i-1)//2==1]
    m=len(g)
    #print(g,m)
    for i in range(m):
        insertionSort(a,n,g[i])
    return a,m,g

n=int(input())
a=[int(input()) for i in range(n)]

a,m,g=shellsort(a,n)

print(m)
print(*g)
print(cnt)
for i in a:
    print(i)

Fixed submission:
def insertionSort(a,n,g):
    for i in range(g,n):
        v=a[i]
        j=i-g
        while j>=0 and a[j]>v:
            a[j+g]=a[j]
            j=j-g
            global cnt
            cnt+=1
        a[j+g]=v

def shellsort(a,n):
    global cnt
    cnt=0
    g=[i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1] if i <= n]
    m=len(g)
    #print(g,m)
    for i in range(m):
        insertionSort(a,n,g[i])
    return a,m,g

n=int(input())
a=[int(input()) for i in range(n)]

a,m,g=shellsort(a,n)

print(m)
print(*g)
print(cnt)
for i in a:
    print(i)
Buggy python submission (verdict: Runtime Error):
s=input()

def r_poland(s):
    stack=[]
    
    for d in s:
        if d.isdigit():
            stack.append(int(d))
        elif d=="+":
            stack[-1]+=stack.pop(-2)
        elif d=="-":
            stack[-1]=stack.pop(-2)-stack[-1]
        elif d=="*":
            stack[-1]*=stack.pop(-2)

    return stack
   
s=input()

print(*r_poland(s))

    

Fixed submission:
def r_poland(s):
    stack=[]
    
    for d in s:
        if d.isdigit():
            stack.append(int(d))
        elif d=="+":
            stack[-1]+=stack.pop(-2)
        elif d=="-":
            stack[-1]=stack.pop(-2)-stack[-1]
        elif d=="*":
            stack[-1]*=stack.pop(-2)

    return stack
   
s=list(input().split())

print(*r_poland(s))
Buggy python submission (verdict: Time Limit Exceeded):
dic=[]
n=int(input())
cmd=[list(input().split()) for i in range(n)]
for c, l in cmd:
    if c=="insert":
        dic.append(l)
    if c=="find":
        if l in dic:
            print("yes")
        else:
            print("no")

Fixed submission:
dic=set()
n=int(input())
cmd=[list(input().split()) for i in range(n)]
for c, l in cmd:
    if c=="insert":
        dic.add(l)
    if c=="find":
        if l in dic:
            print("yes")
        else:
            print("no")
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=list(map(int,input().split()))

d=((x1-x2)**2+(y1-y2)**2)**0.5

print(d)

Fixed submission:
x1,y1,x2,y2=list(map(float,input().split()))

d=((x1-x2)**2+(y1-y2)**2)**0.5

print(d)
Buggy python submission (verdict: Runtime Error):
def min_dist(x_b,y_b):
    s=0
    for x,y in zip(x_b,y_b):
        s+=abs(x-y)
    return s

def man_dist(x_b,y_b):
    s=0
    for x, y in zip(x_b,y_b):
        s+=(abs(x-y))**2
    return s**0.5

def che_dist(x_b,y_b):
    s=0
    for x,y in zip(x_b,y_b):
        s+=(abs(x-y))**3
    return s**(1/3)

def anf_dist(x_b,y_b):
    s=[abs(x-y) for x,y in zip(x_b,y_b)]
    return max(s)

n=int(input())
y_b=list(map(int,input().split()))

print(min_dist(x_b,y_b))
print(man_dist(x_b,y_b))
print(che_dist(x_b,y_b))
print(anf_dist(x_b,y_b))

Fixed submission:
def min_dist(x_b,y_b):
    s=0
    for x,y in zip(x_b,y_b):
        s+=abs(x-y)
    return s

def man_dist(x_b,y_b):
    s=0
    for x, y in zip(x_b,y_b):
        s+=(abs(x-y))**2
    return s**0.5

def che_dist(x_b,y_b):
    s=0
    for x,y in zip(x_b,y_b):
        s+=(abs(x-y))**3
    return s**(1/3)

def anf_dist(x_b,y_b):
    s=[abs(x-y) for x,y in zip(x_b,y_b)]
    return max(s)

n=int(input())
x_b=list(map(int,input().split()))
y_b=list(map(int,input().split()))

print(min_dist(x_b,y_b))
print(man_dist(x_b,y_b))
print(che_dist(x_b,y_b))
print(anf_dist(x_b,y_b))
Buggy python submission (verdict: Runtime Error):
print(a//b,a%b,"{0:.5f}".format(a/b))

Fixed submission:
a,b=list(map(int,input().split()))
print(a//b,a%b,"{0:.5f}".format(a/b))
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r=list(map(int,input().split()))
if r<=x<=(W-r) and r<=y<=(H-r):
    print("Yes")
else:
    print("No")

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

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

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

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

Fixed submission:
import math
r=float(input())
l=math.pi*r*2
s=(r**2)*math.pi
print("{1:6f} {0:6f}".format(l, s))
Buggy python submission (verdict: Runtime Error):
import sys

input_line = sys.stdin.readline()
    
ch=['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']

sl=input_line.lower()

for c in ch:
    print("{} : {}".format(c,s.count(c)))

Fixed submission:
s = ""
while True:
    try:
        sent = input()
    except:
        break
    s += sent
    
ch=['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']

sl=s.lower()

for c in ch:
    cnt=sl.count(c)
    print("{} : {}".format(c,cnt))

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

input_line = sys.stdin.read()
    
ch=['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']

sl=input_line.lower()

for c in ch:
    print("{} : {}".format(c,s.count(c)))

Fixed submission:
s = ""
while True:
    try:
        sent = input()
    except:
        break
    s += sent
    
ch=['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']

sl=s.lower()

for c in ch:
    cnt=sl.count(c)
    print("{} : {}".format(c,cnt))
Buggy python submission (verdict: Runtime Error):
input_line1 = raw_input()
print(input_line1^3)

Fixed submission:
c = int(input())
print(c*c*c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    a, b, c = list(map(int, input())).sort()
    if c ** 2 == (a ** 2 + b ** 2):
        print("Yes")
    else:
        print("No")

Fixed submission:
n = int(input())
for i in range(n):
    a, b, c = sorted(list(map(int, input().split())))
    if c ** 2 == (a ** 2 + b ** 2):
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Runtime Error):
from math import gcd
import sys

for line in sys.stdin:
    a, b = list(map(int, line.split()))
    print("{0} {1}".format(gcd(a, b), (a * b) / gcd(a, b)))

Fixed submission:
import sys

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x

for line in sys.stdin:
    a, b = list(map(int, line.split()))
    print("{0} {1}".format(gcd(a, b), int((a * b) / gcd(a, b))))

Buggy python submission (verdict: Runtime Error):
from math import gcd
import sys

for line in sys.stdin:
    a, b = list(map(int, line.split()))
    print("{0} {1}".format(gcd(a, b), int((a * b) / gcd(a, b))))

Fixed submission:
import sys

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x

for line in sys.stdin:
    a, b = list(map(int, line.split()))
    print("{0} {1}".format(gcd(a, b), int((a * b) / gcd(a, b))))
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def prime(n):
    N = n + 1
    ints = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(N)]
    try:
        ints[0] = ints[1] = False
        ints[2] = ints[3] = ints[5] = True
    except IndexError:
        pass
    sqrt = N ** 0.5

    for i in range(3, N, 2):
        if i >= sqrt:
            break
        for m in range(i ** 2, N, i):
            ints[m] = False
    return ints.count(True)

for line in sys.stdin:
    print(prime(int(line)))

Fixed submission:
import sys

def sieve(n):
    N = n + 1
    ints = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(N)]
    try:
        ints[0] = ints[1] = False
        ints[2] = ints[3] = ints[5] = True
    except IndexError:
        pass
    sqrt = N ** 0.5

    for i in range(3, N, 2):
        if i >= sqrt:
            break
        for m in range(i ** 2, N, i):
            ints[m] = False
    return ints

prime1m = sieve(1000000)

for line in sys.stdin:
    print(prime1m[:int(line) + 1].count(True))
Buggy python submission (verdict: Runtime Error):
w = int(input())
n = int(input())
nums = list(range(w + 1))
for i in range(n):
    s = list(map(int, input().split(", ")))
    nums[s[0]], nums[s[1]] = nums[s[1]], nums[s[0]]
for j in range(w):
    print(nums[j + 1])

Fixed submission:
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(","))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

Buggy python submission (verdict: Runtime Error):
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = list(map(int, input().split(", ")))
    nums[a], nums[b] = nums[b], nums[a]
for i in range(w):
    print(nums[i + 1])

Fixed submission:
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(","))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

Buggy python submission (verdict: Runtime Error):
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(", "))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

Fixed submission:
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(","))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

Buggy python submission (verdict: Runtime Error):
w = int(input())
n = int(input())
nums = list(range(w + 1))
for _ in range(n):
    a, b = map(int, input().split(", "))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)

Fixed submission:
w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
    a, b = map(int, input().split(","))
    nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
    print(x)