#include <bits/stdc++.h>
using namespace std;
int main() {
  bool done = false;
  string s, r;
  string ans = "";
  cin >> s;
  int len = s.length();
  for (int i = 0; i < len; i++) ans += "0";
  int target = s[len - 1] - '0';
  int curr;
  int idx = -1;
  for (int i = 0; i < len - 1; i++) {
    curr = s[i] - '0';
    if (curr % 2 == 0 && curr < target) {
      swap(s[i], s[len - 1]);
      cout << s;
      return 0;
    }
  }
  if (!done) {
    for (int i = len - 2; i >= 0; i--) {
      curr = s[i] - '0';
      if (curr % 2 == 0) {
        done = 1;
        swap(s[i], s[len - 1]);
        cout << s;
        return 0;
      }
    }
  }
  cout << "-1";
  return 0;
}
