#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
int main() {
  int idx = -1;
  string s;
  cin >> s;
  for (int i = 0; i < int(s.length()); ++i) {
    if (!!(((s[i] - '0' & 1) == 1))) continue;
    idx = i;
    if ((s[i] - '0') < (s[s.length() - 1] - '0')) break;
  }
  if (idx != -1) {
    swap(s[idx], s[s.length() - 1]);
    cout << s << endl;
  } else
    cout << -1 << endl;
  return 0;
}
