uses crt;
var n,i,dem,dem1,dem2:integer;
a,b,c,d:array[1..50]of integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{------------------------------dem-so-duong----------------------------------}
dem:=0;
for i:=1 to n do
if a[i]>0 then
begin
inc(dem);
b[dem]:=a[i];
end;
writeln('co ',dem,' so duong trong day A');
writeln('cac so do la: ');
for i:=1 to dem do
write(b[i]:4);
{-----------------------------dem-so-am----------------------------------}
writeln;
dem1:=0;
for i:=1 to n do
if a[i]<0 then
begin
inc(dem1);
c[dem1]:=a[i];
end;
writeln('co ',dem1,' so am trong day A');
writeln('cac so do la: ');
for i:=1 to dem1 do
write(c[i]:4);
{-----------------------------dem-so-0---------------------------------}
writeln;
dem2:=0;
for i:=1 to n do
if a[i]=0 then
begin
inc(dem2);
d[dem2]:=a[i];
end;
writeln('co ',dem2,' so 0 trong day');
writeln('cac so do la: ');
for i:=1 to dem2 do
write(d[i]:4);
readln;
end.