#include #include #include #include using namespace std; int main() { vector odd; vector even; // Read input numbers string input; getline(cin, input); // Read the entire line of input stringstream ss(input); int num; while (ss >> num) { if (num % 2 == 0) even.push_back(num); else odd.push_back(num); } // Sort both vectors sort(odd.begin(), odd.end()); sort(even.begin(), even.end()); // Print odd numbers for (size_t i = 0; i < odd.size(); i++) { cout << odd[i]; if (i != odd.size() - 1) cout << " "; // Print space between numbers } cout << endl; // Print even numbers for (size_t i = 0; i < even.size(); i++) { cout << even[i]; if (i != even.size() - 1) cout << " "; // Print space between numbers } cout << endl; return 0; }