#include using namespace std; #define rep(i,x,y) for(int i=x;i>X; deque v; rep(i,0,X.size()){ v.push_back((int)X[i]-48); }sort(v.begin(),v.end(),greater()); for(int i=v.size()-1;i>=0;i--){ if(v[i]>v.back()){ if(i==0&&v.back()==0){ cout<<-1<