#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int k = 0;
  cin >> s;
  bool flag = false;
  for (int i = 0; i < s.size(); i++)
    if ((s[i] == '0') || (s[i] == '2') || (s[i] == '4') || (s[i] == '6') ||
        (s[i] == '8')) {
      flag = true;
      k++;
    }
  if (!flag)
    cout << -1;
  else {
    for (int i = 0; i < s.size() - 1; i++)
      if ((s[i] == '0') || (s[i] == '2') || (s[i] == '4') || (s[i] == '6') ||
          (s[i] == '8')) {
        if (((int)s[i] < (int)s[s.size() - 1]) || (k == 1)) {
          swap(s[i], s[s.size() - 1]);
          cout << s;
          return 0;
        }
        k--;
      }
  }
  return 0;
}
