string s; { cin>>s; sort(s.begin(), s.end()); next_permutaion(s.begin(), s.end()); for(auto it=s.rbegin();it!=s.rend();++it) wt(*it); }