#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  cin >> str;
  string answer = "-1";
  bool done = false;
  int n = str.length();
  for (int i = 0; i < str.length(); ++i) {
    if (((str[i] - '0') % 2 == 0) && str[i] < str[n - 1]) {
      done = true;
      swap(str[i], str[n - 1]);
      break;
    }
  }
  if (!done) {
    for (int i = n - 2; i >= 0; --i) {
      if ((str[i] - '0') % 2 == 0) {
        done = true;
        swap(str[i], str[n - 1]);
        break;
      }
    }
  }
  if (done)
    cout << str << endl;
  else
    cout << "-1\n";
  return 0;
}
