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