import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
while(sc.hasNext()) {
int a[]=new int[10];
a[0]=sc.nextInt();
a[1]=sc.nextInt();
a[2]=sc.nextInt();
a[3]=sc.nextInt();
a[4]=sc.nextInt();
a[5]=sc.nextInt();
a[6]=sc.nextInt();
a[7]=sc.nextInt();
a[8]=sc.nextInt();
a[9]=sc.nextInt();
int timesou=0;
int timesji=0;
for(int i=0;i<10;i++)
{
if(a[i]%2==0)
{
timesou++;
}
else
{
timesji++;
}
}
int jishu[]=new int[timesji];
int oushu[]=new int[timesou];
int k=0;
int j=0;
for(int i=0;i<10;i++)
{
if(a[i]%2==0)
{
oushu[k]=a[i];
k++;
}
if(a[i]%2!=0)
{
jishu[j]=a[i];
j++;
}
}
Arrays.sort(jishu);
Arrays.sort(oushu);
for(int i=j-1;i>=0;i--)
{
System.out.print(jishu[i]+" ");
}
for(int i=0;i<k;i++)
{
System.out.print(oushu[i]+" ");
}
}
}
}