#include #define rep(i, n) for(int i=0; i<(n); ++i) #define rep1(i,n) for(int i=1; i<=(n); ++i) #define repi(i,a,b) for(int i=a; i<=(b); ++i) #define rrep(i,n) for(int i=(n-1); i>=0; --i) #define ALL(obj) (obj).begin(), (obj).end() #define RALL(obj) (obj).rbegin(), (obj).rend() #define pb push_back #define mp make_pair #define to_s to_string #define sz(v) (int)v.size() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) #define pr(x) cout<<(x)<<'\n' #define debug(x) cout << #x << ": " << (x) << '\n' #define yes "Yes" #define no "No" using namespace std; using ll = long long; using Edge = pair; using Graph = vector>; typedef pair P; struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<= 0){ if(ans[i+1]!=ans[i]){ char tp = ans[i]; ans[i] = ans[i+1]; ans[i+1] = tp; break; } i--; } if(ans[0] == '0' || ans == X) return "-1"; else return ans; } int main(){ string X; cin >> X; pr(solve(X)); return 0; }