program ask15(input,output);
type nodetype=record
info:integer;
next:^nodetype;
end;
var head,node,nodethet,nodearn,headthet,headarn :^nodetype;data:integer;
begin
writeln('Dose osous akeraious ari8mous 8eleis eite 8etikous eite arnhtikous kai meta patise <enter>:');
head:=nil;read(data);
while not eoln do
begin
new(node);node^.info:=data;node^.next:=head;
head:=node;read(data)
end;
if (node^.info>0) then
begin
headthet:=nil;
new(nodethet);nodethet^.info:=node^.info;nodethet^.next:=headthet;headthet:=nodethet;
end
else if (node^.info<0) then
begin
headarn:=nil;
new(nodearn);nodearn^.info:=node^.info;nodearn^.next:=headarn;headarn:=nodearn;
end;
end.