#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long l = s.length() - 1, c = 0, maxa = -1, x = l;
    for (long long i = 0; i < l; i++) {
      if (s[i] % 2 == 0) {
        x = i;
        if (s[l] > s[i]) break;
      }
    }
    if (x != l) {
      swap(s[x], s[l]);
      cout << s << "\n";
    } else
      cout << "-1"
           << "\n";
  }
  return 0;
}
