#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length(), prev_index = -1, prev_num = -1, flag = 0;
  char temp, las;
  las = s[l - 1];
  for (int i = 0; i < l - 1; i++) {
    if ((int)s[i] % 2 == 0) {
      flag = 1;
      if ((int)s[i] < (int)las) {
        if (prev_index != -1 && prev_num != -1) {
          s[prev_index] = (char)prev_num;
          s[l - 1] = las;
        }
        temp = s[i];
        s[i] = s[l - 1];
        s[l - 1] = temp;
        break;
      } else {
        if (prev_index != -1 && prev_num != -1) {
          s[prev_index] = (char)prev_num;
          s[l - 1] = las;
        }
        prev_index = i;
        prev_num = (int)s[i];
        temp = s[i];
        s[i] = s[l - 1];
        s[l - 1] = temp;
      }
    }
  }
  if (flag == 0) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < l; i++) {
    cout << s[i];
  }
  return 0;
}
