a=list(map(int,input().split()))
print(a)
a.sort()
for i in range(len(a)) :
print(a[i])
a.reverse()
for i in range(len(a)) :
print(a[i], end =" ")
YT1saXN0KG1hcChpbnQsaW5wdXQoKS5zcGxpdCgpKSkKcHJpbnQoYSkKYS5zb3J0KCkKZm9yIGkgaW4gcmFuZ2UobGVuKGEpKSA6CglwcmludChhW2ldKQphLnJldmVyc2UoKQpmb3IgaSBpbiByYW5nZShsZW4oYSkpIDoKCXByaW50KGFbaV0sIGVuZCA9IiAiKQ==