dummy = input() map = list(map(int,input().split())) for i in sorted(map,reverse=True)[:5]: print(i,end=' ')