#include <bits/stdc++.h>
using namespace std;
int main() {
  string abc;
  cin >> abc;
  int prev = -1;
  int b = abc[abc.length() - 1] - '0';
  int i = 0;
  for (i = 0; i < abc.length() - 1; i++) {
    int a = abc[i] - '0';
    if (a % 2 == 0) {
      prev = i;
      if (b > a) {
        char temp = abc[i];
        abc[i] = abc[abc.length() - 1];
        abc[abc.length() - 1] = temp;
        cout << abc << "\n";
        return 0;
      }
    }
  }
  if (prev == -1)
    cout << "-1\n";
  else {
    char temp = abc[prev];
    abc[prev] = abc[abc.length() - 1];
    abc[abc.length() - 1] = temp;
    cout << abc << "\n";
  }
  return 0;
}
