#include <stdio.h>
#define A 50
void we(int grade[A], int b)
{
	int n = 0;
	for (n = 0; n < b; n++)
	{
		for (int j = n + 1; j < b; j++)
		{
			if (grade[n] < grade[j])
			{
				int m = 0;
				m = grade[j];
				grade[j] = grade[n];
				grade[n] = m;
			}
		}
			
	}
}
int main()
{
	int grades[A] = { 0 };
	int a = 0;
	int num = 0;
	scanf("%d", &num);
	for (a = 0; a < num; a++) 
	{
		scanf("%d", &grades[a]);
	}
	 we(grades,num);
	for (a = 0; a < 5; a++)
	{
		printf("%d ", grades[a]);
	}
	return 0;
}