uses crt;
var i,n:longint;
a:array[1..100000] of longint;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
write('Cac so duong la: ');
for i:=1 to n do
if a[i]>0 then write(a[i],','); writeln;
write('Cac so am la: ');
for i:=1 to n do
if a[i]<0 then write(a[i],',');
readln
end.