#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long int l, i, x, even = 0, max, temp;
  cin >> s;
  l = s.length();
  x = s[l - 1];
  for (i = (l - 1); i >= 0; i--) {
    if ((s[i] % 2) == 0) {
      even++;
      if (even == 1) {
        max = i;
      }
      if (s[i] < s[l - 1]) {
        max = i;
      }
    }
  }
  if (even > 0) {
    temp = s[l - 1];
    s[l - 1] = s[max];
    s[max] = temp;
    cout << s;
  } else {
    cout << "-1";
  }
  return 0;
}
