#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, temp_s;
  cin >> s;
  temp_s = s;
  int l = s.size();
  int c = 0, temp, t, index_of_LAST_even;
  temp = s[l - 1] - '0';
  if (temp % 2 != 0) {
    for (int i = 0; i < l - 1; ++i) {
      int t = s[i] - '0';
      if (t % 2 == 0) {
        c++;
        index_of_LAST_even = i;
        if (temp > t) {
          swap(s[i], s[l - 1]);
          break;
        }
      }
    }
    if (c == 0)
      cout << -1;
    else {
      if (temp_s == s) {
        swap(s[index_of_LAST_even], s[l - 1]);
      }
      cout << s;
    }
  } else {
    for (int i = 0; i < l - 1; ++i) {
      if (s[i] < temp) {
        swap(s[i], s[l - 1]);
        break;
      }
    }
    cout << s;
  }
  return 0;
}
