#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long cnt = 0;
  for (long long i = 0; i < s.length(); i++) {
    if ((s[i] - '0') % 2 == 0) cnt++;
  }
  if (cnt == 0)
    cout << -1 << endl;
  else {
    vector<char> v;
    for (long long i = 0; i < s.length(); i++) v.push_back(s[i]);
    char c = s[s.length() - 1];
    for (long long i = 0; i < s.length(); i++) {
      if ((s[i] - '0') % 2 == 0) {
        cnt--;
        if (s[i] < c || cnt == 0) {
          v[i] = c;
          v[s.length() - 1] = s[i];
          break;
        }
      }
    }
    cout << string(v.begin(), v.end()) << endl;
  }
}
