#include using namespace std; int main() { int numbers[10]; int blue[10], red[10]; int blueCount = 0, redCount = 0; for (int i = 0; i < 10; i++) { cin >> numbers[i]; if (numbers[i] % 2 == 0) { blue[blueCount++] = numbers[i]; } else { red[redCount++] = numbers[i]; } } for (int i = 0; i < blueCount - 1; i++) { for (int j = i + 1; j < blueCount; j++) { if (blue[i] > blue[j]) { int temp = blue[i]; blue[i] = blue[j]; blue[j] = temp; } } } for (int i = 0; i < redCount - 1; i++) { for (int j = i + 1; j < redCount; j++) { if (red[i] > red[j]) { int temp = red[i]; red[i] = red[j]; red[j] = temp; } } } for (int i = 0; i < blueCount; i++) { cout << blue[i] << " "; } for (int i = redCount - 1; i >= 0; i--) { cout << red[i] << " "; } cout << endl; return 0; }