#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  char s[100005], tp;
  int len, ch = 0;
  cin >> s;
  len = strlen(s);
  tp = s[len - 1];
  for (int i = 0; i < len - 1; i++) {
    if (s[i] < s[len - 1] && (s[i] - '0') % 2 == 0) {
      s[len - 1] = s[i];
      s[i] = tp;
      ch = 1;
      break;
    }
  }
  if (ch != 1) {
    for (int i = len - 2; i >= 0; i--) {
      if ((s[i] - '0') % 2 == 0) {
        s[len - 1] = s[i];
        s[i] = tp;
        ch = 1;
        break;
      }
    }
  }
  if (ch == 1) {
    cout << s << endl;
  } else {
    cout << -1 << endl;
  }
}
