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