program TEK_CIFT;
USES CRT;
VAR
I,J,N,TMP:INTEGER;
A:ARRAY [1..50] OF INTEGER;
BEGIN
CLRSCR;
WRITELN('DIZI ELEMAN SAYISINI GIRINZI');
READLN(N);
WRITELN('DIZI ELEMANLARINI GIRINIZ');
FOR I:=1 TO N DO READLN(A[I]);
I:=1; J:=N;
BEGIN
WHILE (I<J) DO
BEGIN
WHILE (A[I] MOD 2 = 1) AND (I<J) DO
BEGIN
I:=I+1;
END;
WHILE (A[J] MOD 2 = 0) AND (I<J) DO
BEGIN
J:=J-1
END;
TMP:=A[I];
A[I]:=A[J];
A[J]:=TMP;
END;
END;
WRITELN('SON DURUM.....:::');
FOR I:=1 TO N DO WRITELN(A[I]);
READLN;
END.