#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long n = s.length();
  for (long long i = 0; i < n; i++) {
    if ((s[i] - '0') % 2 == 0 && (s[i] < s[n - 1])) {
      swap(s[i], s[n - 1]);
      cout << s << '\n';
      return;
    }
  }
  for (long long i = n - 2; i >= 0; i--) {
    if (s[i] % 2 == 0 && s[i] > s[n - 1]) {
      swap(s[i], s[n - 1]);
      cout << s << '\n';
      return;
    }
  }
  cout << -1 << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
