#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
const int N = (int)5e5 + 7, MOD = (int)1e9 + 7;
string second, ans;
bool ok = 1;
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> second;
  for (int i = 0; i < second.size(); i++) {
    if ((second[i] - '0') % 2 == 0) {
      ok = 0;
    }
  }
  if (ok == 1) {
    cout << -1 << "\n";
    exit(0);
  }
  ans = second;
  for (int i = 0; i < ans.size(); i++) {
    if ((ans[i] - '0') < (ans[ans.size() - 1] - '0') &&
        (ans[i] - '0') % 2 == 0) {
      char z = ans[i];
      ans[i] = ans[ans.size() - 1];
      ans[ans.size() - 1] = z;
      break;
    }
  }
  if (ans == second) {
    for (int i = ans.size() - 1; i >= 0; i--) {
      if ((ans[i] - '0') % 2 == 0) {
        char z = ans[i];
        ans[i] = ans[ans.size() - 1];
        ans[ans.size() - 1] = z;
        break;
      }
    }
  }
  cout << ans << "\n";
  exit(0);
}
