#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, t = 0;
  char temp, k;
  cin >> s;
  n = s.length();
  for (int i = 0; i < n; i++) {
    if (s[i] % 2 == 0) {
      t = i;
      if (s[i] < s[n - 1]) {
        temp = s[n - 1];
        s[n - 1] = s[i];
        s[i] = temp;
        cout << s;
        return 0;
      }
    }
  }
  if (t == 0 && s[0] % 2 != 0) {
    cout << "-1";
    return 0;
  }
  k = s[t];
  s[t] = s[n - 1];
  s[n - 1] = k;
  cout << s;
  return 0;
}
