Program FNG;
Uses crt;
Var A: array[1..1000] of longint;
n,i: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
For i:=1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
End;
For i:=1 to n do
If A[i]<0 then Write(A[i],' ');
For i:=1 to n do
If A[i]=0 then Write(A[i],' ');
For i:=1 to n do
If A[i]>0 then Write(A[i],' ');
Readln
End.