#include<iostream> #include<algorithm> using namespace std; int arr[11]; int main(void) { while (cin >> arr[0] >> arr[1] >> arr[2] >> arr[3] >> arr[4] >> arr[5] >> arr[6] >> arr[7] >> arr[8] >> arr[9]) { sort(arr, arr + 10, greater<int>()); for (int i = 0; i < 10; i++) if (arr[i] % 2 != 0) cout << arr[i] << " "; sort(arr, arr + 10); for (int i = 0; i < 10; i++) if (arr[i] % 2 == 0) cout << arr[i] << " "; } return 0; }