#include <bits/stdc++.h>
char s[100000], c;
int main() {
  int m, n, j, k, l, x, y, z;
  scanf("%s", s);
  n = strlen(s);
  m = -1;
  for (j = 0; j < n; j++)
    if ((s[j] - '0') % 2 == 0) break;
  if (j == n) {
    printf("-1");
    return 0;
  }
  for (j = 0; j < n - 1; j++)
    if ((s[j] - '0') % 2 == 0 && s[j] < s[n - 1]) break;
  if (j == n - 1)
    for (j = n - 2; j >= 0; j--)
      if ((s[j] - '0') % 2 == 0 && s[j] > s[n - 1]) break;
  c = s[j];
  s[j] = s[n - 1];
  s[n - 1] = c;
  printf("%s", s);
  return 0;
}
