#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char a[100001];
  scanf("%s", a);
  int c1 = -1, s = 0;
  for (int i = 0; a[i] != '\0'; i++) {
    s++;
  }
  for (int i = 0; a[i] != '\0'; i++) {
    if (a[i] % 2 == 0) {
      c1 = i;
      if (a[i] < a[s - 1]) {
        break;
      }
    }
  }
  if (c1 == -1) {
    cout << "-1";
    return 0;
  } else {
    char temp = a[s - 1];
    a[s - 1] = a[c1];
    a[c1] = temp;
  }
  for (int i = 0; a[i] != '\0'; i++) {
    cout << a[i];
  }
}
