#include using namespace std; typedef long long ll; typedef pair P; typedef pair Q; #define REP(i,n) for(ll i=0;i> s; ll n=s.size(); string t="",u=""; REP(i,n){ if(s[i]>='a' && s[i]<='z'){ t+=s[i]; }else{ u+=s[i]; } } reverse(t.begin(),t.end()); cout << t+u << endl; return 0; }