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