n=int(input())
m=list(map(int,input().split()))
for i in range(len(m)-1):
    for j in range(len(m)-1-i):
        if m[j]<m[j+1]:
            m[j],m[j+1]=m[j+1],m[j]
for a in range(5):
    print(m[a],end=" ")