uses crt;
const fi='output.txt'
var f1:text;
a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
assign(f1,fi); rewrite(f1);
for i:=1 to n do
if i mod 2=1 then write(f1,a[i]:4);
writeln(f1);
for i:=1 to n do
if a[i] mod 2<>0 then write(f1,a[i]:4);
close(f1);
readln;
end.