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