#include <iostream> using namespace std; int cmp(const void* a, const void* b) { return *(int*)a - *(int*)b; } void reverse(int a[]) { for (int i = 0; i < 5; i++) { int temp = a[i]; a[i] = a[9 - i]; a[9 - i] = temp; } } int main() { int a[10], b[10]; while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] >> a[5] >> a[6] >> a[7] >> a[8] >> a[9]) { qsort(a, 10, sizeof(int), cmp); reverse(a); int l = 0, r = 9; for (int i = 0; i < 10; i++) { if (a[i] % 2) { b[l++] = a[i]; } else { b[r--] = a[i]; } } for (int i = 0; i < 10; i++) { cout << b[i] << " "; } cout << endl; } } // 64 位输出请用 printf("%lld")