var a:array of integer;
N,i,k1,k2,k3:integer;
BEGIN
readln(N);
SetLength(a,N);
for i:=0 to N-1 do begin
read(a[i]);
if (a[i]=0) then k3:=k3+1;
if (a[i]>0) then k1:=k1+1;
if (a[i]<0) then k2:=k2+1;
end;
writeln(k1);
writeln(k2);
writeln(k3);
for i:=0 to N-1 do
write(a[i],' ');
end.
var a:array of integer;
N,i,k1,k2,k3:integer;
BEGIN
readln(N);
SetLength(a,N);
for i:=0 to N-1 do begin
read(a[i]);
if (a[i]=0) then k3:=k3+1;
if (a[i]>0) then k1:=k1+1;
if (a[i]<0) then k2:=k2+1;
end;
writeln(k1);
writeln(k2);
writeln(k3);
for i:=0 to N-1 do
write(a[i],' ');
end.