#解答里面代码写的太麻烦了4行就行了
n = int(input())
a = list(map(int,input().split()))
t = int(input())
print(*sorted(a,reverse=t))