По паскале !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Var i, n: integer; a: array[1..1000000]of integer; begin readln(n); for i := 1 to n do read(a[i]); for i := 1 to n do if(a[i] mod 2 = 0) then write(a[i], ' '); for i := 1 to n do if(a[i] mod 2 <> 0) then write(a[i], ' '); end.