#include <bits/stdc++.h>
using namespace std;
vector<pair<char, int>> a;
int main() {
  string s;
  cin >> s;
  bool flag = 0;
  int count = 0;
  for (int i = 0; i < s.size(); i++) {
    if ((s[i] - '0') % 2 == 0) {
      count++;
      a.push_back({s[i], i});
    }
  }
  if (count == 0) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < count; i++) {
    if (s[s.size() - 1] >= a[i].first) {
      flag = 1;
      swap(s[a[i].second], s[s.size() - 1]);
      break;
    }
  }
  if (!flag) {
    swap(s[a[count - 1].second], s[s.size() - 1]);
  }
  cout << s << endl;
}
