program CodeTranslation;
const
nmax = 1000007;
var
a: array[1..nmax] of Int64;
b: array[1..nmax] of Int64;
function cmp(a, b: Int64): Boolean;
begin
if (a mod 2 = 0) and (b mod 2 = 0) then
Result := a < b
else if (a mod 2 = 0) and (b mod 2 <> 0) then
Result := a > b
else if (a mod 2 <> 0) and (b mod 2 <> 0) then
Result := b < a;
end;
var
n, i: Int64;
begin
ReadLn(n);
for i := 1 to n do
begin
ReadLn(a[i]);
end;
for i := 1 to n do
begin
Write(a[i], ' ');
end;
end.