#include <iostream> #include <algorithm> #include <vector> using namespace std; int a[10]; int main() { while(cin>>a[0]){ for(int i=1;i<=9;i++) cin>>a[i]; sort(a,a+10); vector<int> jiShu,ouShu; for(int i=0;i<10;i++){ if(a[i]%2==0) ouShu.push_back(a[i]); else jiShu.push_back(a[i]); } for(int i=jiShu.size()-1;i>=0;i--) cout<<jiShu[i]<<" "; for(int i=0;i<ouShu.size();i++) cout<<ouShu[i]<<" "; cout<<endl; } return 0; }