Program NN;
Uses crt;
Var A: array[1..10000] of longint;
n,i,j,tg: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
For i:=1 to n do Read(A[i]);
For i:=1 to n-1 do
For j:=i+1 to n do
If abs(A[i])<abs(A[j]) then
Begin
tg:=A[i];
A[i]:=A[j];
A[j]:=tg;
End;
For i:=1 to n do Write(A[i],' ');
Readln
End.