#include <bits/stdc++.h>
using namespace std;
string str;
int main() {
  cin >> str;
  int pos = -1;
  bool allodd = true;
  int last = str[str.size() - 1] - '0';
  for (int i = 0; i < str.size(); i++) {
    int x = str[i] - '0';
    if (x % 2 == 0)
      allodd = false;
    else
      continue;
    if (x < last) {
      swap(str[i], str[str.size() - 1]);
      cout << str << endl;
      return 0;
    } else if (x > last)
      pos = i;
  }
  if (allodd) {
    puts("-1");
    return 0;
  }
  swap(str[pos], str[str.size() - 1]);
  cout << str << endl;
  return 0;
}
