#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string ans = "";
  int m = 9, ei = s.length() - 1;
  for (int i = 0; i < s.length() - 1; i++) {
    if ((s[i] - '0') % 2 == 0) {
      ei = i;
      m = (s[i] - '0');
      if (m < s[s.length() - 1] - '0') break;
    }
  }
  s[ei] = s[s.length() - 1];
  s[s.length() - 1] = m + 48;
  (m == 9) ? cout << "-1" : cout << s;
  return 0;
}
