stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<cstring>

using namespace std;

int c[20000+200];

int a[3000000+200];

int n;



void countSort(){

    memset(c,0,sizeof(c));

    for(int i=0;i<n;i++){

        c[a[i]]++;

    }

    int index=0;

    for(int i=0;i<10000+10;i++){

        while(c[i]){

            a[index++]=i;

            c[i]--;

        }

        if(index==n)

            break;

    }

    printf("%d",a[0]);

    for(int i=1;i<n;i++){

        printf(" %d",a[i]);

    }

    cout<<endl;

    return;

}



int main(){

    cin>>n;

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }

    countSort();

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.468013954485369x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

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

	}

	for(i=0;i<n;i++)

	{

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

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int x;

    scanf("%d",&x);

    int arr[x+1];

    for(int i=0;i<x;i++)

        scanf("%d",&arr[i]);

    sort(arr,arr+x);

    for(int i=0;i<x;i++)

    {

        if(i==x-1)

            printf("%d\n",arr[i]);

        else

            printf("%d ",arr[i]);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.076001189247865x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

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

	}

	for(i=0;i<n;i++)

	{

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

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <string>

#include <set>

#include <cstdio>

#include <cstring>

#include <queue>

#include <stack>

#include <algorithm>

#include <cmath>

#define ll long long

#define INF 0x3f3f3f3f

#define SIS std::ios::sync_with_stdio(false)

using namespace std;



int main()

{

    SIS;

    int n;

    while(cin>>n)

    {

        vector <int> s;

        int num;

        for(int i=0;i<n;i++)

        {

            cin>>num;

            s.push_back(num);

        }

        sort(s.begin(),s.end());

        for(int i=0;i<n;i++)

            if(i==0)

                cout<<s[i];

            else

                cout<<" "<<s[i];

        cout<<endl;

    }

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 4.2182240616347695x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

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

	}

	for(i=0;i<n;i++)

	{

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

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int n,a[2000001],freq[100100];



void countingsort(int a[]){

    for(int i=1;i<=n;i++){

        freq[a[i]]++;

    }

    int idx=0;

    for(int i=0;i<=10000;i++){

        for(int j=1;j<=freq[i];j++){

            idx++;

            a[idx]=i;

        }

    }

}



int main(){

    cin>>n;

    for(int i=1;i<=n;i++){

        cin>>a[i];

    }

    countingsort(a);

    for(int i=1;i<=n;i++){

        cout<<a[i];

        if(i==n){

            cout<<endl;

        }else{

            cout<<" ";

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 4.3070606425489615x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

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

	}

	for(i=0;i<n;i++)

	{

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

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int A[2000005], B[2000005], C[10005];



void CountingSort(int n) {

    int k = 10000;

    for (int i = 0; i <= k; i++) C[i] = 0;



    for (int j = 0; j < n; j++) C[A[j]]++;



    for (int i = 1; i <= k; i++) C[i] += C[i - 1];



    for (int j = n - 1; j >= 0; j--) {

        B[C[A[j]] - 1] = A[j];

        C[A[j]]--;

    } 

}



int main() {

    int n;

    cin >> n;

    for (int i = 0; i < n; i++) cin >> A[i];

    CountingSort(n);

    for (int i = 0; i < n; i++) cout << B[i] << (i != n - 1 ? " " : "\n");

}


// Faster C++ solution for the same problem (measured speedup: 4.316731860856172x):
/*

#include<iostream>

using namespace std;



int A[2000005], B[2000005], C[10005];



void CountingSort(int n) {

    int k = 10000;

    for (int i = 0; i <= k; i++) C[i] = 0;



    for (int j = 0; j < n; j++) C[A[j]]++;



    for (int i = 1; i <= k; i++) C[i] += C[i - 1];



    for (int j = n - 1; j >= 0; j--) {

        B[C[A[j]] - 1] = A[j];

        C[A[j]]--;

    } 

}



int main() {

    int n;

    cin >> n;

    for (int i = 0; i < n; i++) cin >> A[i];

    CountingSort(n);

    for (int i = 0; i < n; i++) cout << B[i] << (i != n - 1 ? " " : "\n");

}

*/



#include<stdio.h>

#include<stdlib.h>

#define MAX 2000001

#define VMAX 10000



int main() {

    unsigned short *A, *B;



    int C[VMAX + 1];

    int n, i, j;

    scanf("%d", &n);



    A = (unsigned short *)malloc(sizeof(unsigned short) * (n + 1));

    B = (unsigned short *)malloc(sizeof(unsigned short) * (n + 1));



    for (i = 0; i <= VMAX; i++) C[i] = 0;



    for (i = 0; i < n; i++) {

        scanf("%hu", &A[i + 1]);

        C[A[i + 1]]++;

    }



    for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i - 1];



    for (j = 1; j <= n; j++) {

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

        C[A[j]]--; 

    }



    for (i = 1; i <= n; i++) {

        if (i > 1) printf(" ");

        printf("%d", B[i]);

    }

    printf("\n");



    return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define MAX 20000001

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1];

	int n, i, j;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i-1];



	for (j = 1; j <= n; j++) {

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

		C[A[j]]--;

	}



	for (i = 1; i <= n; i++) {

		if (i > 1) printf(" ");

		printf("%d", B[i]);

	}

	printf("\n");



	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5681525991993839x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i, max=(1<<30)*-1;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



//	C = (unsigned short*)malloc(sizeof(short) * max + 1);

//	for (i = 0; i <= max; i++) C[i] = 0;



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = 1; i <= n; i++) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.570001082551489x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i, max=(1<<30)*-1;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



//	C = (unsigned short*)malloc(sizeof(short) * max + 1);

//	for (i = 0; i <= max; i++) C[i] = 0;



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5700558280847563x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i, max=(1<<30)*-1;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



//	C = (unsigned short*)malloc(sizeof(short) * max + 1);

//	for (i = 0; i <= max; i++) C[i] = 0;



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define MAX 20000001

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1];

	int n, i, j;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i-1];



	for (j = 1; j <= n; j++) {

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

		C[A[j]]--;

	}



	for (i = 1; i <= n; i++) {

		if (i > 1) printf(" ");

		printf("%d", B[i]);

	}

	printf("\n");



	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5681525991993839x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	int max = (1<<30)*-1;

	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = 1; i <= n; i++) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.570001082551489x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	int max = (1<<30)*-1;

	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5700558280847563x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;//, *C;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

	}



	int max = (1<<30)*-1;

	for (i = 1; i <= n; i++) max = MAX(max, A[i]);

	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define MAX 20000001

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1];

	int n, i, j;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i-1];



	for (j = 1; j <= n; j++) {

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

		C[A[j]]--;

	}



	for (i = 1; i <= n; i++) {

		if (i > 1) printf(" ");

		printf("%d", B[i]);

	}

	printf("\n");



	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5705578401103353x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	int max = (1<<30)*-1;

	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		max = MAX(max, A[i]);

	}



	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = 1; i <= n; i++) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.5724091586761717x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	int max = (1<<30)*-1;

	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		max = MAX(max, A[i]);

	}



	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.572463988178433x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;



	int n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	int max = (1<<30)*-1;

	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		max = MAX(max, A[i]);

	}



	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define MAX 20000001

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1];

	int n, i, j;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i-1];



	for (j = 1; j <= n; j++) {

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

		C[A[j]]--;

	}



	for (i = 1; i <= n; i++) {

		if (i > 1) printf(" ");

		printf("%d", B[i]);

	}

	printf("\n");



	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.5705264265389738x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;



	int n, i, max;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	max = (1<<30)*-1;

	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		max = MAX(max, A[i+1]);

	}



	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<stdlib.h>

#define VMAX 20000



int main() {



	unsigned short *A, *B;



	int C[VMAX + 1], n, i;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	for (i = 0; i <= VMAX; i++) C[i] = 0;



	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		C[A[i+1]]++;

	}



	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];



	for (i = 1; i <= n; i++) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.5723777080755925x):
#include<stdio.h>

#include<stdlib.h>

#define MAX(x, y) (((x) > (y)) ? (x) : (y))



int main() {



	unsigned short *A, *B;



	int n, i, max;

	scanf("%d", &n);



	A = (unsigned short*)malloc(sizeof(short) * n + 1);

	B = (unsigned short*)malloc(sizeof(short) * n + 1);



	max = (1<<30)*-1;

	for (i = 0; i < n; i++) {

		scanf("%hu", &A[i+1]);

		max = MAX(max, A[i+1]);

	}



	int C[max+1] = {0};



	for (i = 0; i < n; i++) C[A[i+1]]++;

	for (i = 1; i <= max; i++) C[i] += C[i-1];



	for (i = n; i >= 1; i--) {

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

		C[A[i]]--;

	}



	printf("%d", B[1]);

	for (i = 2; i <= n; i++) {

		printf(" %d", B[i]);

	}

	printf("\n");



	free(A);

	free(B);

	return 0;

}