#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string n;
  cin >> n;
  char a;
  long long flag = 1;
  a = n[n.size() - 1] - '0';
  long long max = -1000;
  string s;
  int pos = -1;
  if (a % 2 != 0) {
    for (long long i = 0; i < n.size() - 1; ++i) {
      char b;
      b = n[i] - '0';
      if (b % 2 == 0) {
        if (a > b) {
          s = n;
          char c = s[i];
          s[i] = s[s.size() - 1];
          s[s.size() - 1] = c;
          flag = 0;
          break;
        } else {
          pos = i;
        }
      }
    }
    if (!flag) {
      cout << s << endl;
    } else {
      if (pos != -1) {
        s = n;
        char c = s[pos];
        s[pos] = s[s.size() - 1];
        s[s.size() - 1] = c;
        cout << s << endl;
      } else {
        cout << "-1" << endl;
      }
    }
  }
  return 0;
}
