import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num = Integer.parseInt(scan.nextLine());
String scoresStr = scan.nextLine();
String[] scoresStrs = scoresStr.split(" ");
List<Integer> scores = new ArrayList<>();//利用List存储所有学生的成绩
for(String score : scoresStrs) {
scores.add(Integer.parseInt(score));
}
Collections.sort(scores);//从小到大排序
for(int i = num - 1; i > num - 6; i--) {//从大到小输出前五个
System.out.print(scores.get(i) + " ");
}
}
}