#include<iostream> #include<cstdio> #include<algorithm> using namespace std; bool Descend(int a,int b){ return a>b; } int main(){ int array[10]; while(scanf("%d",&array[0])!=EOF){ for(int i=1;i<10;++i){ scanf("%d",&array[i]); } sort(array,array+10,Descend); for(int i=0;i<10;++i){ if(array[i]%2==1){ cout<<array[i]<<" "; } } sort(array,array+10); for(int i=0;i<10;++i){ if(array[i]%2==0){ cout<<array[i]<<" "; } } cout<<endl; } return 0; }