#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool ok = false;
  int id = -1;
  int sz = s.size() - 1;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] % 2 == 0) {
      if (s[i] <= s[sz]) {
        id = i;
        ok = true;
        break;
      } else {
        id = i;
        ok = true;
      }
    }
  }
  if (!ok) {
    cout << "-1\n";
  } else {
    swap(s[sz], s[id]);
    cout << s << "\n";
  }
}
