#include <bits/stdc++.h>
using namespace std;
int main() {
  char num[100001];
  cin >> num;
  long long len = strlen(num), cnt1 = 0, j, cnt2 = 0;
  short flag = 0;
  for (long long i = 0; i < len - 1; i++) {
    if (num[i] % 2 == 0) cnt1++;
    if (num[i] % 2 == 0 && num[i] > num[len - 1]) {
      cnt2++;
      j = i;
    }
  }
  if (cnt1 == 0) {
    cout << "-1";
  } else if (cnt1 == cnt2) {
    swap(num[j], num[len - 1]);
    cout << num;
  } else {
    for (long long i = 0; i < len - 1; i++) {
      if (num[i] % 2 == 0 && num[i] < num[len - 1]) {
        swap(num[i], num[len - 1]);
        cout << num;
        break;
      }
    }
  }
}
