#include <bits/stdc++.h> using namespace std; const int N = 20; int a[N]; int main(){ int n = 10; while (cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]>>a[8]>>a[9]){ vector<int> odd; vector<int> even; for (int i=0; i<n; i++){ if (a[i] % 2 == 0){ even.push_back(a[i]); } else{ odd.push_back(a[i]); } } sort(odd.begin(), odd.end(), greater<int>()); sort(even.begin(), even.end()); for (auto item : odd) printf("%d ", item); for (auto item : even) printf("%d ", item); } return 0; }