#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int i, c = 0;
  bool x = false;
  cin >> s;
  for (i = s.size() - 1; i >= 0; i--) {
    if (int(s[i] - '0') % 2 == 0) {
      x = true;
      if (c == 0) c = i;
      if (s[i] < s[s.size() - 1]) c = i;
    }
  }
  char b = s[s.size() - 1];
  s[s.size() - 1] = s[c];
  s[c] = b;
  if (x)
    cout << s << endl;
  else
    cout << -1 << endl;
  return 0;
}
