n=int(eval(input()))

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

m=10001

B=A[:]

C=[0]*m

for a in A:C[a]+=1

for i in range(1,m):C[i]+=C[i-1]

for j in A[::-1]:B[C[j]-1]=j;C[j]-=1

print((*B))

eval(input())

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

B=[]

C=[0]*(max(A)+1)

for a in A:C[a]+=1

i=0

for k in C:B+=[str(i)]*k;i+=1

print((' '.join(B)))

n = int(eval(input()))
A = list(map(int, input().split()))
m = 10001
B = A[:]
C = [0] * m
for a in A:
    C[a] += 1
for i in range(1, m):
    C[i] += C[i - 1]
for j in A[::-1]:
    B[C[j] - 1] = j
    C[j] -= 1
print((*B))

eval(input())
A = list(map(int, input().split()))
B = []
C = [0] * (max(A) + 1)
for a in A:
    C[a] += 1
i = 0
for k in C:
    B += [str(i)] * k
    i += 1
print((" ".join(B)))

-n = int(eval(input())) +eval(input()) -m = 10001 -B = A[:] -C = [0] * m +B = [] +C = [0] * (max(A) + 1) -for i in range(1, m): -    C[i] += C[i - 1] -for j in A[::-1]: -    B[C[j] - 1] = j -    C[j] -= 1 -print((*B)) +i = 0 +for k in C: +    B += [str(i)] * k +    i += 1 +print((" ".join(B)))