#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[100010];
  string s;
  cin >> s;
  int i = 0, length = int((s).size());
  int lastevenindex = -1;
  bool flag = false;
  for (int i = 0; i < length; i++) {
    if ((s[i] - '0') % 2 == 0) {
      if (s[i] - '0' < s[length - 1] - '0') {
        char temp = s[i];
        s[i] = s[length - 1];
        s[length - 1] = temp;
        flag = true;
        lastevenindex = i;
        break;
      }
      lastevenindex = i;
    }
  }
  if (lastevenindex == -1)
    cout << -1 << endl;
  else if (!flag) {
    char temp = s[lastevenindex];
    s[lastevenindex] = s[length - 1];
    s[length - 1] = temp;
    cout << s << endl;
  } else {
    cout << s << endl;
  }
  return 0;
}
