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