#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int odd = (int)s[s.length() - 1];
  int prev = -1;
  int flag = 0;
  int even = -1;
  for (int i = 0; i < s.length() - 1; i++) {
    even = (int)s[i];
    if (even % 2 == 0) {
      prev = i;
      if (odd > even) {
        s[i] = (char)odd;
        s[s.length() - 1] = (char)even;
        cout << s;
        flag = 1;
        break;
      }
    }
  }
  if (flag == 0) {
    if (prev != -1) {
      s[s.length() - 1] = s[prev];
      s[prev] = (char)odd;
      cout << s;
    } else {
      cout << "-1";
    }
  }
  return 0;
}
