#重要なところは、a.sort(reverse=True)の箇所
昇順
n = int(input())
a = [0]*n
for i in range(n):
a[i] = int(input())
a.sort()
for i in range(n):
print(a[i])
#降順
n = int(input())
a = [0]*n
for i in range(n):
a[i] = int(input())
a.sort(reverse=True)
for i in range(n):
print(a[i])
#辞書型のソート
n = int(input())
ab = [None]*n
for i in range(n):
[a,b] = input().split()
a = int(a)
b = int(b)
ab[i] = [a,b]
ab.sort(reverse=True)
for i in range(n):
[a,b] = ab[i]
print(a,b)
入力例1
2
1 3
2 2
出力例1
2 2
1 3