#include <stdio.h>
int main(){
    int rs = 0;
    int score[40] = {0};
    scanf("%d",&rs);
    int i = 0;
    while(i < rs){
        scanf("%d ",&score[i]);
        i++;
    }
    int j = 0;
    int k = 0;
    //冒泡排序
    for( i = 0; i<rs-1; i++){  /* 外循环为排序趟数,rs 个数进行 rs-1 趟 */
        for( j = 0; j < rs-1-i; j++){ /* 内循环为每趟比较的次数,第i趟比较rs-i次 */
            if(score[j] < score[j+1]){ /* 相邻元素比较,若逆序则交换(升序为左大于右,降序反之) */
                k =score[j];
                score[j] = score[j+1];
                score[j+1] = k;
            }
        }
    }
    for(i = 0; i<5;i++){
        printf("%d ",score[i]);
    }
    return 0;
}