#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, lastpos = -1, flag = 0;
  string s;
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    if ((s[i] - '0') % 2 == 0) {
      lastpos = i;
      if (s[i] < s[n - 1]) swap(s[i], s[n - 1]), flag = 1;
    }
    if (flag == 1) break;
  }
  if (flag == 0) {
    if (lastpos == -1)
      cout << -1 << "\n";
    else {
      swap(s[lastpos], s[n - 1]);
      cout << s << "\n";
    }
  } else
    cout << s << "\n";
  return 0;
}
