#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n - 1; i++) {
    if (s[i] != '0' && s[i] != '2' && s[i] != '4' && s[i] != '6' && s[i] != '8')
      continue;
    if (s[i] < s[n - 1]) {
      swap(s[i], s[n - 1]);
      cout << s << "\n";
      return 0;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] != '0' && s[i] != '2' && s[i] != '4' && s[i] != '6' && s[i] != '8')
      continue;
    swap(s[i], s[n - 1]);
    cout << s << "\n";
    return 0;
  }
  cout << "-1\n";
  return 0;
}
