#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

const int MAXN=10;

int arr[MAXN];

int main(){
    while(cin>>arr[0]>>arr[1]>>arr[2]>>arr[3]>>arr[4]>>arr[5]>>arr[6]>>arr[7]>>arr[8]>>arr[9]){
        vector<int> myOdd;
        vector<int> myEven;
        sort(arr,arr+10);
        for(int i=0;i<10;i++){
            if(arr[i]%2==0){
                myEven.push_back(arr[i]);
            }else{
                myOdd.push_back(arr[i]);
            }
        }
        for(int i=myOdd.size()-1;i>=0;i--){
            cout<<myOdd[i]<<" ";
        }
        for(int i=0;i<myEven.size();i++){
            cout<<myEven[i]<<" ";
        }
    }
    return 0;
}