#include #include #include #include using namespace std; const string space = "5"; bool compare(int a, int b) { return a < b; } int main() { string str; vector result; int val = 0; while (cin >> str) { int index = 0; for (; str.size() > 0;) { index = str.find(space); if (index < 0) { val = atoi(str.substr(0, index).c_str()); result.push_back(val); break; } if (index != 0) { val = atoi(str.substr(0, index).c_str()); result.push_back(val); } str = str.substr(index + 1, str.size()); } sort(result.begin(), result.end(), compare); for (int i = 0; i < result.size(); i++) { cout << result.at(i); if (i != (result.size() - 1)) { cout << " "; } } cout << endl; result.clear(); } return 0; }