Const n=5;
var a:array[1..n,1..n] of integer;
b,c:array[1..n*n] of integer;
k1,k2,i,j:integer;
begin
k1:=0;
k2:=0;
for i:=1 to n do
for j:=1 to n do begin
read(a[i,j]);
if odd(a[i,j]) then begin inc(k2); c[k2]:=a[i,j]; end
else begin inc(k1); b[k1]:=a[i,j]; end;
end;
writeln('Четные');
for i:=1 to k1 do
write(b[i],' ');
writeln();
writeln('Нечетные');
for i:=1 to k2 do
write(c[i],' ');
end.