#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  cin >> s;
  int idx = -1;
  int num = s[s.size() - 1];
  bool param = false;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] % 2 == 0 and s[i] < num) {
      idx = i;
      swap(s[i], s[s.size() - 1]);
      break;
    }
  }
  if (idx == -1) {
    for (int i = s.size() - 2; i >= 0; i--) {
      if (s[i] % 2 == 0) {
        idx = i;
        swap(s[i], s[s.size() - 1]);
        break;
      }
    }
  }
  if (idx == -1) {
    cout << -1 << endl;
  } else {
    cout << s << endl;
  }
}
