#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c = 0, d = 0, e, f, g, n, t, i, j;
  string s;
  cin >> s;
  a = s.size();
  for (i = 0; i < a; i++)
    if (s[i] % 2 == 0) {
      b = i;
      c++;
      if (s[a - 1] > s[i]) break;
    }
  if (c > 0) {
    swap(s[b], s[a - 1]);
    cout << s << endl;
  } else
    cout << "-1" << endl;
}
