n = int(eval(input()))

A = [int(i) for i in input().split()]

B = [0] * n

k = max(A)

C = [0] * (k + 1)

for i in range(0, n):

    C[A[i]] += 1

for i in range(1, k + 1):

    C[i] += C[i - 1]

for i in range(n - 1, -1, -1):

    C[A[i]] -= 1

    B[C[A[i]]] = A[i]

print((*B))
n = int(eval(input()))

def CountingSort(A, B, k):

    C = [0] * (k + 1)

    for j in range(n):

        C[A[j]] += 1

    C[0] -= 1

    for i in range(1, k + 1):

        C[i] += C[i - 1]

    for j in range(n - 1, -1, -1):

        B[C[A[j]]] = A[j]

        C[A[j]] -= 1

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

B = [0] * n

CountingSort(A, B, max(A))

print((*B))



n = int(eval(input()))
A = [int(i) for i in input().split()]
B = [0] * n
k = max(A)
C = [0] * (k + 1)
for i in range(0, n):
    C[A[i]] += 1
for i in range(1, k + 1):
    C[i] += C[i - 1]
for i in range(n - 1, -1, -1):
    C[A[i]] -= 1
    B[C[A[i]]] = A[i]
print((*B))

n = int(eval(input()))


def CountingSort(A, B, k):
    C = [0] * (k + 1)
    for j in range(n):
        C[A[j]] += 1
    C[0] -= 1
    for i in range(1, k + 1):
        C[i] += C[i - 1]
    for j in range(n - 1, -1, -1):
        B[C[A[j]]] = A[j]
        C[A[j]] -= 1


A = list(map(int, input().split()))
B = [0] * n
CountingSort(A, B, max(A))
print((*B))

-A = [int(i) for i in input().split()] + + +def CountingSort(A, B, k): +    C = [0] * (k + 1) +    for j in range(n): +        C[A[j]] += 1 +    C[0] -= 1 +    for i in range(1, k + 1): +        C[i] += C[i - 1] +    for j in range(n - 1, -1, -1): +        B[C[A[j]]] = A[j] +        C[A[j]] -= 1 + + +A = list(map(int, input().split())) -k = max(A) -C = [0] * (k + 1) -for i in range(0, n): -    C[A[i]] += 1 -for i in range(1, k + 1): -    C[i] += C[i - 1] -for i in range(n - 1, -1, -1): -    C[A[i]] -= 1 -    B[C[A[i]]] = A[i] +CountingSort(A, B, max(A))