#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t, i, n = -1, ans, x = -1;
  char c;
  string s;
  t = 1;
  while (t--) {
    cin >> s;
    n = s[s.length() - 1] - '0';
    c = s[s.length() - 1];
    for (i = 0; i < s.length(); i++) {
      int p = (s[i] - '0');
      if (p % 2 == 0) {
        if (n > p) {
          x = i;
          break;
        } else {
          x = i;
        }
      }
    }
    if (x != -1) {
      s[s.length() - 1] = s[x];
      s[x] = c;
      cout << s;
    } else
      cout << "-1";
    if (t != 0) cout << "\n";
  }
  return 0;
}
