#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.size(), f = 0, save = -1, rem;
  int temp = s[len - 1] - 48;
  for (int i = 0; i < len; i++) {
    int m = s[i] - 48;
    if (m % 2 == 0) {
      f = 1;
      rem = i;
      if (temp > m) {
        save = i;
        break;
      }
    }
  }
  if (f == 0) {
    cout << -1 << endl;
    return 0;
  }
  if (save == -1) {
    swap(s[rem], s[len - 1]);
  } else {
    swap(s[save], s[len - 1]);
  }
  cout << s << endl;
  return 0;
}
