#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  if (!s[n - 1] & 1) {
    for (int i = 0; i < n; i++) {
      if (s[i] % 2 == 0 && s[i] < s[n - 1]) {
        swap(s[i], s[n - 1]);
        break;
      }
    }
    cout << s << endl;
  } else {
    int count = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] % 2 == 0) count++;
    }
    if (count == 0)
      cout << "-1";
    else {
      for (int i = 0; i < n; i++) {
        if (s[i] % 2 == 0) {
          count--;
          if (count == 0)
            swap(s[i], s[n - 1]);
          else if (s[i] < s[n - 1]) {
            swap(s[i], s[n - 1]);
            break;
          }
        }
      }
      cout << s << endl;
    }
  }
}
