import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();//要输入成绩的个数
        int[] arr = new int[n];//用来存放输入的成绩
        for(int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }
        Arrays.sort(arr);//给数组正排序
        for(int i = n - 1; i > n - 6; i--) {
            System.out.print(arr[i] + " ");
        }
    }
}