#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int smalla = 97;
int biga = 65;
int char0 = 48;
void solve(int tc) {
  string s;
  cin >> s;
  int a[s.size()];
  int i = 0;
  for (i = 0; i < s.size(); i++) {
    a[i] = s[i] - 48;
  }
  int last = a[s.size() - 1];
  int mini = -1;
  bool found = false;
  for (i = s.size() - 2; i >= 0; i--) {
    if (a[i] % 2 == 0) {
      if (found) {
        if (a[i] < last) mini = i;
      } else {
        mini = i;
        found = true;
      }
    }
  }
  if (!found) {
    cout << -1 << "\n";
    return;
  }
  swap(a[mini], a[s.size() - 1]);
  for (i = 0; i < s.size(); i++) cout << a[i];
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  int c = 1;
  while (t--) {
    solve(c);
    c++;
  }
}
