#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string str, t;
  int len, posmin, posmax, x, y;
  cin >> str;
  len = str.length();
  posmin = posmax = -1;
  for (int i = 0; i < len - 1; ++i) {
    x = str[i] - '0';
    if (x % 2 == 0) {
      if (str[i] < str[len - 1]) {
        posmin = i;
        break;
      }
    }
  }
  for (int i = 0; i < len - 1; ++i) {
    x = str[i] - '0';
    if (x % 2 == 0) {
      if (str[i] < str[len - 1]) {
        posmin = i;
        break;
      }
    }
  }
  for (int i = len - 2; i >= 0; --i) {
    x = str[i] - '0';
    if (x % 2 == 0) {
      if (str[i] > str[len - 1]) {
        posmax = i;
        break;
      }
    }
  }
  if (posmin == -1 && posmax == -1) {
    puts("-1");
  } else {
    t = str;
    if (posmin == -1) {
      swap(t[posmax], t[len - 1]);
      cout << t << endl;
    } else if (posmax == -1) {
      swap(str[posmin], str[len - 1]);
      cout << str << endl;
    } else {
      swap(t[posmax], t[len - 1]);
      swap(str[posmin], str[len - 1]);
      if (str > t)
        cout << str << endl;
      else
        cout << t << endl;
    }
  }
  return 0;
}
