#include <bits/stdc++.h>
int main() {
  std::string aux;
  std::cin >> aux;
  short vec[aux.length()];
  bool even = false;
  for (int x = 0; x < aux.length(); ++x) {
    vec[x] = aux[x] - '0';
    if (vec[x] % 2 == 0) {
      even = true;
    }
  }
  if (!even)
    std::cout << -1;
  else {
    bool flag = false, found1 = false;
    int min = vec[aux.length() - 1], fnd, pos = aux.length() - 1;
    for (int x = aux.length() - 2; x >= 0; --x) {
      if (vec[x] < min and vec[x] % 2 == 0) {
        pos = x;
        flag = true;
      }
      if (vec[x] % 2 == 0 and !found1) {
        found1 = true;
        fnd = x;
      }
    }
    if (flag) {
      std::swap(vec[aux.length() - 1], vec[pos]);
    } else
      std::swap(vec[aux.length() - 1], vec[fnd]);
    for (int out = 0; out < aux.length(); ++out) std::cout << vec[out];
  }
  return 0;
}
