LearnPy Hub
← Lists problems
Medium

Sort by Size, Ignoring the Sign

Read integers and sort them by absolute value with sorted(a, key=abs). Ties keep their original order. Print the result.

Input

One line.

Output

One line.

Sample 1

Input
-5 3 -1 2
Output
-1 2 3 -5

Sample 2

Input
0 -0 1
Output
0 0 1
solution.py
Output appears here
Sort by Size, Ignoring the Sign · Python practice problem · LearnPy Hub