#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    int flag = 0;
    int num = -1, snum = -1;
    for (int i = 0; i < s.size(); i++) {
      if ((s[i] - '0') % 2 == 0) {
        flag = 1;
        if (s[i] < s[s.size() - 1]) {
          num = i;
          break;
        }
        snum = i;
      }
    }
    if (!flag) {
      printf("-1\n");
      continue;
    } else if (num == -1)
      swap(s[snum], s[s.size() - 1]);
    else
      swap(s[num], s[s.size() - 1]);
    cout << s << endl;
  }
  return 0;
}
