Sorting
Completed
Read a line of integers. Print them sorted ascending, then sorted descending.
Input
One line of space-separated integers.
Output
Two lines.
Example
Input
5 2 9 1 5
Output
1 2 5 5 9 9 5 5 2 1
Editor
Python
Hints
sorted(list) returns a new sorted list.
reverse=True sorts from largest to smallest.
Solution explanation
sorted() returns a new list; list.sort() sorts in place and returns None.
Show solution
nums = list(map(int, input().split()))
print(*sorted(nums))
print(*sorted(nums, reverse=True))