#include #include #include using namespace std; int main(){ string X; cin >> X; sort(X.rbegin(), X.rend()); if (X[1] == '0'){ cout << -1 << endl; } else { int N = X.size(); for (int i = N - 2; i >= 0; i--){ if (X[i] != '0'){ swap(X[i], X[i + 1]); break; } } cout << X << endl; } }