#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  cin >> n;
  int ind = -1;
  int indn = -1;
  int l = n.length();
  for (int i = l - 1; i >= 0; i--) {
    if (n[i] == '0' || n[i] == '2' || n[i] == '4' || n[i] == '6' ||
        n[i] == '8') {
      if (n[i] < n[l - 1]) {
        indn = i;
      }
    }
  }
  for (int i = 0; i < l - 1; i++) {
    if (n[i] == '0' || n[i] == '2' || n[i] == '4' || n[i] == '6' ||
        n[i] == '8') {
      if (n[i] > n[l - 1]) {
        ind = i;
      }
    }
  }
  if (indn != -1) {
    swap(n[indn], n[l - 1]);
  } else if (indn == -1 && ind != -1) {
    swap(n[ind], n[l - 1]);
  } else if (indn == -1 && ind == -1) {
    cout << -1;
    return 0;
  }
  cout << n;
}
