#include <bits/stdc++.h>
using namespace std;
string arr;
int N;
int main() {
  cin >> arr;
  int N = arr.length();
  int min_first = arr[N - 1] - '0';
  int min_last = 10;
  int index_first = -1;
  int index_last = -1;
  for (int i = 0; i < N; i++) {
    int value = arr[i] - '0';
    if (value % 2 == 0) {
      if (index_first == -1) {
        if (value < min_first) {
          min_first = value;
          index_first = i;
        }
      }
      min_last = value;
      index_last = i;
    }
  }
  if (index_first == -1) {
    if (index_last == -1) {
      cout << "-1";
    } else {
      swap(arr[index_last], arr[N - 1]);
      cout << arr;
    }
  } else {
    swap(arr[index_first], arr[N - 1]);
    cout << arr;
  }
  return 0;
}
