#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i, j, n = s.length(), f = 0;
  char a, b;
  for (i = 0; i < s.length(); i++) {
    if (((int)s[i] - 48) % 2 == 0) {
      f = 1;
      a = s[i];
      j = i;
      if (((int)s[i] - 48) < ((int)s[n - 1] - 48)) {
        s[i] = s[n - 1];
        s[n - 1] = a;
        cout << s;
        return 0;
      }
    }
  }
  if (f == 1) {
    s[j] = s[n - 1];
    s[n - 1] = a;
    cout << s;
  } else
    cout << "-1";
  return 0;
}
