#include <bits/stdc++.h>
using namespace std;
int num(char x) {
  int y = x - '0';
  return y;
}
int main() {
  string s;
  cin >> s;
  int l = s.length();
  int x = s[l - 1] - '0';
  int key = 0;
  int fuck = 0;
  int index;
  for (int i = l - 2; i >= 0; i--) {
    if (num(s[i]) % 2 == 0 && key == 0) {
      char temp = s[i];
      s[i] = s[l - 1];
      s[l - 1] = temp;
      index = i;
      key = 1;
      fuck = 1;
    } else if (num(s[i]) % 2 == 0 && num(s[i]) < x) {
      char temp__ = s[index];
      s[index] = s[l - 1];
      s[l - 1] = temp__;
      char temp_ = s[i];
      s[i] = s[l - 1];
      s[l - 1] = temp_;
      fuck = 1;
      index = i;
    }
  }
  if (fuck == 0)
    cout << -1;
  else
    cout << s;
  return 0;
}
