#include <bits/stdc++.h>
using namespace std;
int main() {
  string st;
  cin >> st;
  int l = st.length();
  int d = st[l - 1] - '0';
  int f = -1;
  int k = -1;
  for (int i = 0; i < l - 1; i++) {
    if ((st[i] - '0') % 2 == 0 && st[i] - '0' < d) {
      f = i;
      break;
    }
    if ((st[i] - '0') % 2 == 0) {
      k = i;
    }
  }
  if (f != -1) {
    st[l - 1] = st[f];
    st[f] = d + '0';
    cout << st;
  } else {
    if (k == -1) {
      cout << -1;
    } else {
      st[l - 1] = st[k];
      st[k] = d + '0';
      cout << st;
    }
  }
  return 0;
}
