#include <bits/stdc++.h>
using namespace std;
int main() {
  string val;
  cin >> val;
  int cngIn1 = -1;
  int lDigit = int(val[val.length() - 1] - '0');
  for (int i = val.length() - 2; i >= 0; i--) {
    int dig = int(val[i] - '0');
    if ((dig % 2 == 0) && (dig < lDigit)) {
      cngIn1 = i;
    }
  }
  string sNewVal1 = val;
  if (cngIn1 != -1) {
    sNewVal1[sNewVal1.length() - 1] = val[cngIn1];
    sNewVal1[cngIn1] = val[sNewVal1.length() - 1];
  }
  int cngIn2 = -1;
  for (int i = val.length() - 2; i >= 0; i--) {
    int dig = int(val[i] - '0');
    if ((dig % 2 == 0) && (dig > lDigit)) {
      cngIn2 = i;
      break;
    }
  }
  string sNewVal2 = val;
  if (cngIn2 != -1) {
    sNewVal2[sNewVal2.length() - 1] = val[cngIn2];
    sNewVal2[cngIn2] = val[sNewVal2.length() - 1];
  }
  if ((sNewVal1 == val) && (sNewVal2 == val)) {
    cout << -1;
  } else if (sNewVal1 == val) {
    cout << sNewVal2;
  } else if (sNewVal2 == val) {
    cout << sNewVal1;
  } else {
    cout << sNewVal1;
  }
}
