#include <bits/stdc++.h>
int main() {
  int i = 0, z, flag = 0, even = 0;
  char str[100002], temp;
  scanf("%s", str);
  int size = strlen(str);
  char x = str[size - 1];
  for (i = 0; i < size; i++) {
    if (str[i] % 2 == 0) {
      even = 1;
      if (str[i] < x) {
        flag = 1;
        str[size - 1] = str[i];
        str[i] = x;
        break;
      } else {
        z = i;
      }
    }
  }
  if (i >= size && even == 1) {
    flag = 1;
    str[size - 1] = str[z];
    str[z] = x;
  }
  if (flag == 1) {
    printf("%s", str);
  } else
    printf("-1");
  return 0;
}
