Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
#from me.io import dup_file_stdin

primes = [2,3,5,7]

def isPrime(x):
    if x<=primes[-1]:
        return x in primes
    else:
        for prime in primes:
            if x%prime==0:
                return False
        else:
            current=primes[-1]
            dst=math.sqrt(x)
            while current<dst:
                if(x%current==0):
                    return False
            else:
                return True

#@dup_file_stdin
def solve():
    for query in map(int,sys.stdin):
        if(query>primes[-1]):
            for i in range(primes[-1]+1,query+1):
                if isPrime(i):
                    primes.append(i);
        print(len([x for x in primes if x<=query]))
solve()

Fixed submission:
import sys
#from me.io import dup_file_stdin

N=1000000
primes = [1]*N
primes[0:2]=[0,0,1]

for i in range(2,N):
    if primes[i]==1:
        j=i+i
        while j<=N:
            primes[j]=0
            j+=i

#@dup_file_stdin
def solve():
    for query in map(int,sys.stdin):
        print(sum(primes[2:query+1]))
solve()
Buggy python submission (verdict: Runtime Error):
import re
#from me.io import dup_file_stdin

#@dup_file_stdin
def solve():
    for _ in range(int(sys.stdin.readline())):
        expr = sys.stdin.readline()[:-1].strip("=")
        expr = re.sub(".d+","",expr)
        print(eval(expr.replace("/","//")))
 
solve()

Fixed submission:
import sys
#from me.io import dup_file_stdin

def prec(op):
    if op in "+-":return 1
    if op in "*/":return 2
    raise NotImplementedError()
    
def postFix(expr):
    stack = []
    operators = []
    num = 0
    isdigit = False
    for ch in expr:
        if ch.isdigit():
            isdigit = True
            num*=10
            num+=int(ch)
            continue
        else :
            if isdigit:
                stack.append(num)
                num = 0
            isdigit = False
            
            if ch == ')':
                while len(operators) > 0:
                    op = operators.pop()
                    if op == '(':
                        break
                    else:
                        stack.append(op)
                else:
                    raise ValueError
            elif ch == '(':
                operators.append(ch)
            else:
                while len(operators) > 0 and operators[-1]!='(' and prec(operators[-1]) >= prec(ch):
                    stack.append(operators.pop())
                operators.append(ch)
    if isdigit:
        stack.append(num)
    for op in operators[::-1]:
        if op not in "()":
            stack.append(op)
    return stack
        
def evaluate(stack):
    op = stack.pop()
    if type(op) is int:
        return op;
    else:
        b = evaluate(stack);
        a = evaluate(stack);
        return int(eval(str(a)+op+str(b)))

#@dup_file_stdin
def solve():
    for _ in range(int(sys.stdin.readline())):
        expr = sys.stdin.readline()[:-1].strip("=")
        print(evaluate(postFix(expr)))
        
solve()
Buggy python submission (verdict: Runtime Error):
import sys
l = sys.stdin.readline()
list = map(int, l.split())
a = list[0]
b = list[1]

if a > b: print("a > b" % (a, b))
elif a < b: print("a < b" % (a, b))
else: print("a == b" % (a, b))

Fixed submission:
import sys
l = sys.stdin.readline()
list = map(int, l.split())
a = list[0]
b = list[1]

if a > b: print("a > b")
elif a < b: print("a < b")
else: print("a == b")
Buggy python submission (verdict: Time Limit Exceeded):
import queue
def allvisited():
    for i in range(w):
        for j in range(h):
            if (visited[i][j]==False and s[i][j]=='1'):
                return (False,i,j)
    else:
         return (True,-1,-1)
        
def legal(pos):
    if(0<=pos[0]<w) and (0<=pos[1]<h) and s[pos[0]][pos[1]]=='1' and visited[pos[0]][pos[1]]==False:
        return True
    else:
        return False
    
d=[[0,1],[0,-1],[1,0],[-1,0],[1,1],[-1,1],[1,-1],[-1,-1]]
while(1):
    h,w=map(eval,input().split())
    if (w==0 and h==0): break
    s=[]
    for i in range(w):
        s.append(input().split())
    #print(s)
    Q=queue.Queue()
    visited=[]
    for i in range(w):
        visited.append([False]*h)
    #print(visited)
    count=0
    while(1):
        a=allvisited()
        if (a[0]==False):
            Q.put((a[1],a[2]))
            count+=1
        else:
            break
        while(not Q.empty()):
            now=Q.get()
            visited[now[0]][now[1]]=True
            for i in range(8):
                new=(now[0]+d[i][0],now[1]+d[i][1])
                if(legal(new)):
                    Q.put(new)
    print(count)
            

Fixed submission:
import queue
def allvisited():
    for i in range(w):
        for j in range(h):
            if (visited[i][j]==False and s[i][j]=='1'):
                return (False,i,j)
    else:
         return (True,-1,-1)
        
def legal(pos):
    if(0<=pos[0]<w) and (0<=pos[1]<h) and s[pos[0]][pos[1]]=='1' and visited[pos[0]][pos[1]]==False:
        return True
    else:
        return False
    
d=[[0,1],[0,-1],[1,0],[-1,0],[1,1],[-1,1],[1,-1],[-1,-1]]
while(1):
    h,w=map(eval,input().split())
    if (w==0 and h==0): break
    s=[]
    for i in range(w):
        s.append(input().split())
    #print(s)
    Q=queue.Queue()
    visited=[]
    for i in range(w):
        visited.append([False]*h)
    #print(visited)
    count=0
    while(1):
        a=allvisited()
        if (a[0]==False):
            Q.put((a[1],a[2]))
            visited[a[1]][a[2]]=True
            count+=1
        else:
            break
        while(not Q.empty()):
            now=Q.get()
            for i in range(8):
                new=(now[0]+d[i][0],now[1]+d[i][1])
                if(legal(new)):
                    Q.put(new)
                    visited[new[0]][new[1]]=True
    print(count)
Buggy python submission (verdict: Runtime Error):
while 1:
    a,b=map(int,input().split())
    print(len(str(a+b)))

Fixed submission:
while 1:
    try:
        a,b=map(int,input().split())
        print(len(str(a+b)))
    except:
        break
Buggy python submission (verdict: Runtime Error):
N=int(input())
while 1:
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2       
    if A+B==C:
        print('YES')
    elif A+C==B:
        print('YES')
    elif B+C==A:
        print('YES')
    else:
        print('NO')

Fixed submission:
N=int(input())
for i in range(N):
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:print('YES')
    elif A+C==B:print('YES')
    elif B+C==A:print('YES')
    else:print('NO')

Buggy python submission (verdict: Runtime Error):
N=int(input())
while 1:
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    for i in len(N):
        if A+B==C:
            print('YES')
        elif A+C==B:
            print('YES')
        elif B+C==A:
            print('YES')
        else:
            print('NO')

Fixed submission:
N=int(input())
for i in range(N):
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:print('YES')
    elif A+C==B:print('YES')
    elif B+C==A:print('YES')
    else:print('NO')
Buggy python submission (verdict: Runtime Error):
import fractions as f
while 1:    
    a,b=map(int,input().split())
    print(str(f.gcd(a,b))+' '+str(a*b//f.gcd(a,b)))

Fixed submission:
import sys
for i in sys.stdin:
    a,b=map(int,i.split())
    if a<b:a,b=b,a
    def gcd(x,y):
        while y>0:x,y=y,x%y
        return x
    def lcm(x,y):
         return x*y/gcd(x,y)
    print(gcd(a,b),int(lcm(a,b)))
Buggy python submission (verdict: Runtime Error):
print(input().reversed)

Fixed submission:
print(input()[::-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    if ((y1-y2)/(x1-x2))==((y4-y3)/(x4-x3)) or (y1-y2)/(x1-x2)==((y3-y4)/(x3-x4)):
        print('YES')
    else:
        print('NO')


Fixed submission:
n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print('YES' if abs((y1-y2)*(x3-x4)-(y3-y4)*(x1-x2))<1e-10 else 'NO')

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    if ((y1-y2)/(x1-x2))==((y4-y3)/(x4-x3)) or (y1-y2)/(x1-x2)==((y3-y4)/(x3-x4)):
        print('YES')
    else:
        print('NO')


Fixed submission:
n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print('YES' if abs((y1-y2)*(x3-x4)-(y3-y4)*(x1-x2))<1e-10 else 'NO')
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,input().split())
print(float((abs(x1-x2)**2)+abs(y1-y2)**2)**(1/2))

Fixed submission:
v,w,x,y=map(float,input().split())
print(float((abs(v-x)**2)+abs(w-y)**2)**(1/2))
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print(str("{:.6f}".format(r*r*math.pi)+' '+str("{:.6f}".format(2*r*math.pi))))

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
x=r*math.pi
print(str("{:.6f}".format(r*x)+' '+str("{:.6f}".format(2*x))))

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
x=r*math.pi
print("{:.6f}".format(r*x)+' '+"{:.6f}".format(2*x))

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

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

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

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

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

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

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))

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

Fixed submission:
from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))
Buggy python submission (verdict: Runtime Error):
while True:
    a,op,b=input().split()
    a,b=map(int,(a,b))        
    if op=='?':
        None
    elif op=='+':
        print(str(int(a+b)))
    elif op=='-':
        print(str(int(a-b)))
    elif op=='*':
        print(str(int(a*b)))
    else:
        print(str(int(a//b)))

Fixed submission:
while True:
    a,op,b=input().split()
    a,b=map(int,(a,b))
    if op=='?':
        break
    elif op=='+':
        print(str(int(a+b)))
    elif op=='-':
        print(str(int(a-b)))
    elif op=='*':
        print(str(int(a*b)))
    else:
        print(str(int(a//b)))
Buggy python submission (verdict: Runtime Error):
m,f,r=map(int,input().split())
if m==-1 or f==-1 or m+f<30:
    print('F')
elif m==f==r==-1:
    break
elif m+f>=80:
    print('A')
elif 65<=m+f<80:
    print('B')
elif 50<=m+f<65 or r>=50:
    print('C')
else:
    print('D')

Fixed submission:
p=print
while 1:
    m,f,r=map(int,input().split())
    x=m+f
    if m==f==r==-1:break
    elif m==-1 or f==-1 or x<30:p('F')
    elif x>=80:p('A')
    elif 65<=x<80:p('B')
    elif 50<=x<65 or r>=50:p('C')
    else:p('D')
Buggy python submission (verdict: Runtime Error):
i=input
p=print
s=i()
p=i()
p('Yes') if (s+s).count(p) else p('No')

Fixed submission:
s=input()
p=input()
print('Yes'if p in s*2 else'No')

Buggy python submission (verdict: Runtime Error):
i=input
p=print
s=i()
p=i()
(s+s).count(p) if p('Yes') else p('No')

Fixed submission:
s=input()
p=input()
print('Yes'if p in s*2 else'No')
Buggy python submission (verdict: Runtime Error):
tt=input()
a=''
while True:
    text=input().upper
    if text=='END_OF_TEXT':
        break
    a+=text
print(a.count(tt))

Fixed submission:
import sys
a=input()
print(sys.stdin.read().upper().split().count(a.upper()))
Buggy python submission (verdict: Runtime Error):
def inp():
    try:
        while True:
            data=raw_input()
            if not data: break
            yield data
    except KeyboardInterrupt:
        return
sorted(list(inp()),reverse=True)[:3]

Fixed submission:
n=[]
for i in range(0, 10):
    n.append(int(raw_input()))
for i in sorted(n,reverse=True)[:3]:
    print i

Buggy python submission (verdict: Runtime Error):
def minput():
    try:
        while True:
            data=raw_input()
            if not data: break
            yield data
    except KeyboardInterrupt:
        return
sorted(list(minput()),reverse=True)[:3]

Fixed submission:
n=[]
for i in range(0, 10):
    n.append(int(raw_input()))
for i in sorted(n,reverse=True)[:3]:
    print i

Buggy python submission (verdict: Runtime Error):
n = map(int, raw_input().split())
sorted(n),reverse=True)[:3]

Fixed submission:
n=[]
for i in range(0, 10):
    n.append(int(raw_input()))
for i in sorted(n,reverse=True)[:3]:
    print i
Buggy python submission (verdict: Runtime Error):
def inp():
    try:
        while True:
            data=raw_input()
            if not data: break
            yield data
    except KeyboardInterrupt:
        return
A = [map(int, i.split()) for i in list(inp())]
for i in A:
    print len(str(i[0]*i[1]))

Fixed submission:
results=[]
from sys import stdin
for line in stdin:
    a, b = (int(i) for i in line.split())
    results.append(len(str(a+b)))
for i in results:
    print i

Buggy python submission (verdict: Runtime Error):
def inp():
    while True:
        data=raw_input()
        if not data: break
        yield data
A = [map(int, i.split()) for i in list(inp())]
for i in A:
    print len(str(i[0]*i[1]))

Fixed submission:
results=[]
from sys import stdin
for line in stdin:
    a, b = (int(i) for i in line.split())
    results.append(len(str(a+b)))
for i in results:
    print i

Buggy python submission (verdict: Runtime Error):
A = [map(int, i.split()) for i in list(iter(raw_input, ''))]
for i in A:
    print len(str(i[0]*i[1]))

Fixed submission:
results=[]
from sys import stdin
for line in stdin:
    a, b = (int(i) for i in line.split())
    results.append(len(str(a+b)))
for i in results:
    print i

Buggy python submission (verdict: Runtime Error):
A = [map(int, i.split()) for i in list(iter(raw_input, ''))]
for i in A:
    print len(str(i[0]*i[1]))

Fixed submission:
results=[]
from sys import stdin
for line in stdin:
    a, b = (int(i) for i in line.split())
    results.append(len(str(a+b)))
for i in results:
    print i

Buggy python submission (verdict: Runtime Error):
while 1:
    line=raw_input()
    if line == 'END_OF_TEXT': break
    a, b = (int(i) for i in line.split())
    print len(str(a+b))

Fixed submission:
results=[]
from sys import stdin
for line in stdin:
    a, b = (int(i) for i in line.split())
    results.append(len(str(a+b)))
for i in results:
    print i
Buggy python submission (verdict: Runtime Error):
# coding=utf-8

sentence = input()
sentence.__reversed__()
print(sentence)

Fixed submission:
# coding=utf-8

sentence = input()
sentence = sentence[::-1]
print(sentence)
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8


def calc_weights(weight):
    weights_list = []
    counter = 0
    while weight > 0:
        if weight % 2 == 0:
            weight /= 2
        else:
            weights_list.append(2**counter)
        counter += 1
    print(' '.join(map(str, weights_list)))


if __name__ == '__main__':
    while True:
        try:
            W = int(input())
            calc_weights(W)
        except EOFError:
            break



Fixed submission:
# coding=utf-8


def calc_weights(weight):
    weights_list = []
    counter = 0
    while weight > 0:
        if weight % 2 == 0:
            weight /= 2
        else:
            weights_list.append(2**counter)
            weight = (weight - 1)/2
        counter += 1
    print(' '.join(map(str, weights_list)))


if __name__ == '__main__':
    while True:
        try:
            W = int(input())
            calc_weights(W)
        except EOFError:
            break
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8


def fib(number):
    if number == 0 or number == 1:
        return 1
    return fib(number-1) + fib(number-2)


if __name__ == '__main__':
    N = int(input())
    print(fib(N))



Fixed submission:
# coding=utf-8


def fib(number):
    if number == 0 or number == 1:
        return 1
    memo1 = 1
    memo2 = 1

    for i in range(number-1):
        memo1, memo2 = memo1+memo2, memo1
    return memo1


if __name__ == '__main__':
    N = int(input())
    print(fib(N))
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

for i in range(1,N):
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	B = [print(" ".join({A[k]})) for k in range(N)]

Fixed submission:
N = int(input())

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

for i in range(1,N):
	print(" ".join(map(str, A)))
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
print(" ".join(map(str, A)))

Buggy python submission (verdict: Runtime Error):
N = int(input())

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

for i in range(1,N):
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	B = [print(" ".join(A[k])) for k in range(N)]

Fixed submission:
N = int(input())

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

for i in range(1,N):
	print(" ".join(map(str, A)))
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
print(" ".join(map(str, A)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

RMax = 0
R = []


for i in range(N):
	r = int(input())
	if i == 1:
		RMax = r - R[0]
	if i > 0:
		rmi = min(R)
		rdif = (r - rmi)
		if rdif >= RMax:
			RMax = rdif
	R.append(r)

print(RMax)

Fixed submission:
N = int(input())

RMax = 0
R = []


for i in range(N):
	r = int(input())
	if i == 0:
		rmi = r
	if i == 1:
		RMax = r - R[0]
	if i > 0:		
		rdif = (r - rmi)
		if rdif >= RMax:
			RMax = rdif
	R.append(r)
	if r < rmi:
		rmi = r

print(RMax)
Buggy python submission (verdict: Runtime Error):
def isStable(inlist, outlist):
	for i in range(0, N):
		for j in range(i+1, N):
			for a in range(0, N):
				for b in range(a+1, N):
					if int(inlist[i][1:]) == int(inlist[j][1:]) && inlist[i] == outlist[b] && inlist[j] == outlist[a]:
						return FALSE
						break
	else:
		return TRUE
	
N = int(input())
A = input().split()
B = A
C = A

flag = 1
counter = 0
while flag:
    flag = 0
    for i in reversed(range(1,N)):
        if int(C[i][1:]) < int(C[i-1][1:]):
            C[i], C[i-1] = C[i-1], C[i]
            counter += 1
            flag = 1
print(" ".join(map(str, C)))

if(isStable(A, C)):
	print("Stable")
else:
	print("Not Stable")

counter=0
for i in range(N):
	Br = B[i:]
	Brr = [int(Br[j][1:]) for j in range(N-i+1)]
	num = Brr.index(min(Brr)) 
	if num != 0:
		B[i], B[(i+num)] = B[(i+num)], B[i]
		counter += 1
print(" ".join(map(str,B)))
if(isStable(A, B)):
	print("Stable")
else:
	print("Not Stable")

Fixed submission:
def isStable(inlist, outlist):
	flag = True
	for i in range(0, N):
		for j in range(i+1, N):
			for a in range(0, N):
				for b in range(a+1, N):
					if int(inlist[i][1:]) == int(inlist[j][1:]) and inlist[i] == outlist[b] and inlist[j] == outlist[a]:
						flag = False
						break
				else:
					continue
				break
			else:
				continue
			break
		else:
			continue
		break

	return(flag)
N = int(input())
A = input().split()
B = A[:]
C = A[:]

flag = 1
counter = 0
while flag:
    flag = 0
    for i in reversed(range(1,N)):
        if int(C[i][1:]) < int(C[i-1][1:]):
            C[i], C[i-1] = C[i-1], C[i]
            counter += 1
            flag = 1
print(" ".join(map(str, C)))

if(isStable(A, C)):
	print("Stable")
else:
	print("Not stable")

counter=0
for i in range(N):
	Br = B[i:]
	Brr = [int(Br[j][1:]) for j in range(N-i)]
	num = Brr.index(min(Brr)) 
	if num != 0:
		B[i], B[(i+num)] = B[(i+num)], B[i]
		counter += 1
print(" ".join(map(str,B)))
if(isStable(A, B)):
	print("Stable")
else:
	print("Not stable")
Buggy python submission (verdict: Runtime Error):
from collection import deque

D = deque() 
N = int(input())
for i in range(N):
	c, s = input().split()
	if c == "insert":
		d.append(s)
	elif c == "find":
		if (s in d):
			print(Yes)
		else:
			print(No)

Fixed submission:
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

Buggy python submission (verdict: Runtime Error):
from collections import deque

D = deque()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		d.append(s)
	elif c == "find":
		if (s in d):
			print(Yes)
		else:
			print(No)

Fixed submission:
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

D = deque()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.append(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

Fixed submission:
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

Buggy python submission (verdict: Runtime Error):
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.append(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

Fixed submission:
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")
Buggy python submission (verdict: Runtime Error):
# coding=utf-8
def counting_sort(input_list: list, upper: int) -> list:
    number = len(input_list)

    # noinspection PyUnusedLocal
    b = [0 for i in range(number+1)]
    # noinspection PyUnusedLocal
    counter_list = [0 for i in range(upper+1)]

    for j in input_list:
        counter_list[j] += 1

    for i in range(k+1):
        counter_list[i] += counter_list[i-1]

    for j in range(number):
        b[counter_list[input_list[j]]] = input_list[j]
        counter_list[input_list[j]] -= 1

    return b


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    k = 100
    a = counting_sort(a, k)
    a.pop(0)

    print(' '.join(map(str, a)))

Fixed submission:
# coding=utf-8
def counting_sort(input_list: list, upper: int) -> list:
    number = len(input_list)

    # noinspection PyUnusedLocal
    b = [0 for i in range(number+1)]
    # noinspection PyUnusedLocal
    counter_list = [0 for i in range(upper+1)]

    for j in input_list:
        counter_list[j] += 1

    for i in range(k+1):
        counter_list[i] += counter_list[i-1]

    for j in range(number):
        b[counter_list[input_list[j]]] = input_list[j]
        counter_list[input_list[j]] -= 1

    return b


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    k = 2000000
    a = counting_sort(a, k)
    a.pop(0)

    print(' '.join(map(str, a)))