n=int(input()) # 必须有int()函数,否则报错
series=input()
sort_direction=int(input()) # 必须有int()函数,否则报错
l=[int(i) for i in series.split()]
if sort_direction==0:
l.sort()
l_str=map(str,l)
print(' '.join(l_str))
elif sort_direction==1:
l.sort(reverse=True)
l_str=map(str,l)
print(' '.join(l_str))

京公网安备 11010502036488号