#include #include #include using namespace std; int main() { vector odd, even; int num; while (cin >> num) { if (num % 2 == 0) { even.push_back(num); } else { odd.push_back(num); } } sort(odd.begin(), odd.end()); sort(even.begin(), even.end()); for (int n : odd) { cout << n << " "; } cout << endl; for (int n : even) { cout << n << " "; } cout << endl; return 0; }