N=int(input()) L=list(map(int,input().split())) A=L[:-1] B=L[-1:] #print(A,B) A.sort() L=A+B print(*L)