#include <bits/stdc++.h>
using namespace std;
int a[10],b[10],c[10],m=0,n=0;
bool comp(int x,int y){
return x>y;
}
int main(){
for(int i = 0 ; i < 10 ; i++){
cin >> a[i];
if(a[i]%2!=0) b[m++]=a[i];
else c[n++]=a[i];
}
sort(b,b+m,comp);
sort(c,c+n);
for(int i = 0 ; i < m ; i++){
cout << b[i] <<" ";
}
for(int j = 0 ; j < n ; j++){
cout << c[j] <<" ";
}
return 0;
}