#include <algorithm> #include <iostream> using namespace std; string s; char res[1000]; bool cmp(char a, char b) { if(a >= 'A' && a <= 'Z') a += 32; if(b >= 'A' && b <= 'Z') b += 32; return a < b; } bool isletter(char a) { if(a >= 'A' && a <= 'Z' || (a >= 'a' && a <= 'z')) return true; return false; } int main() { while(getline(cin, s)) { string t = ""; for(int i = 0; i < s.size(); i++) { if(isletter(s[i])) t += s[i]; } stable_sort(t.begin(), t.end(), cmp); for(int i = 0; i < s.size(); i++) { if(!isletter(s[i])) t.insert(t.begin() + i, s[i]); } cout << t << endl; } }