#include <bits/stdc++.h>
using namespace std;
string number;
int main() {
  cin >> number;
  int l = number.length();
  char p = number[l - 1];
  int found = 0, i, id;
  for (i = l - 2; i >= 0; i--) {
    if (!(number[i] & 1) && p > number[i]) {
      found = 1;
      id = i;
    } else if (!(number[i] & 1) && p == number[i])
      id = i;
    if (!(number[i] & 1) && p < number[i] && found == 0) {
      found = 2;
      id = i;
    }
  }
  if (found) {
    swap(number[l - 1], number[id]);
    cout << number << endl;
  } else
    cout << "-1" << endl;
  return 0;
}
