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