#include <bits/stdc++.h>
using namespace std;
double pi = 3.141592653589793238462;
string numkey = "0123456789";
string uni = "abcdefghijklmnopqrstuvwxyz";
bool check(long long int n) {
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
signed main() {
  string s;
  cin >> s;
  long long int n = s.length();
  vector<pair<char, long long int> > v;
  for (long long int i = 0; i < n; i++) {
    if ((s[i] - '0') % 2 == 0) {
      if (s[i] - '0' < s[n - 1] - '0') {
        swap(s[n - 1], s[i]);
        cout << s;
        return 0;
      }
    }
  }
  for (long long int i = n - 2; i >= 0; i--) {
    if ((s[i] - '0') % 2 == 0) {
      swap(s[n - 1], s[i]);
      cout << s;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
