Question
The Supernova Magnitude Sort

An astronomer maintains a star catalogue where brightness values are stored in sorted order — but some stars have negative brightness offsets (dimmer than baseline) and some have positive (brighter). The astronomer needs to publish a new catalogue sorted by absolute brightness (the square of each value), in non-decreasing order.

Given a sorted array of brightness values (which may include negatives), return a new array of their squares sorted in non-decreasing order.

Input

The first line contains KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression space-separated integers in non-decreasing order.

Output

KaTeX can only parse string typed expression space-separated integers — the squares in non-decreasing order.

Example
Example 1:
Input
5

-4 -1 0 3 10
Output
0 1 9 16 100

Example 2:
Input
4

-7 -3 2 3
Output
4 9 9 49

Online