#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int f = s.length(), l = s.length() - 1;
  for (int i = 0; i < l; i++) {
    if ((s[i] - '0') % 2 == 0) {
      f = i;
      if (s[l] - '0' > s[i] - '0') {
        break;
      }
    }
  }
  if (f == s.length()) {
    cout << "-1\n";
  } else {
    char sw = s[f];
    s[f] = s[l];
    s[l] = sw;
    cout << s << endl;
  }
  return 0;
}
