#include <bits/stdc++.h>
using namespace std;
long long MODULAR_POWER(long long a, long long b, long long MOD) {
  if (b == 0) return 1LL;
  long long d = MODULAR_POWER(a, b / 2, MOD);
  d *= d;
  d %= MOD;
  if (b % 2) d *= a;
  d %= MOD;
  return d;
}
long long BINARY_SEARCH(long long dp[], long long n, long long key) {
  long long s = 1;
  long long e = n;
  while (s <= e) {
    long long mid = (s + e) / 2;
    if (dp[mid] == key)
      return mid;
    else if (dp[mid] > key)
      e = mid - 1;
    else
      s = mid + 1;
  }
  return -1;
}
string CONVERT_TO_BINARY(long long s) {
  string res = "";
  while (s != 0) {
    res += (char)('0' + s % 2);
    s /= 2;
  }
  reverse(res.begin(), res.end());
  return res;
}
bool PALIN(string s) {
  long long i = 0;
  long long j = s.length() - 1;
  while (i <= j) {
    if (s[i] != s[j]) return false;
    j--, i++;
  }
  return true;
}
long long STOI(string s) {
  long long num = 0;
  long long po = 1;
  for (long long i = s.length() - 1; i >= 0; i--) {
    num += po * (s[i] - '0');
    po *= 10;
  }
  return num;
}
int main() {
  string s;
  cin >> s;
  char a = s.size() - 1;
  bool flag = false;
  long long pos = -1;
  for (long long i = 0; i <= s.size() - 2; i++) {
    if ((s[i] - '0') % 2 == 0) {
      pos = i;
      if (s[i] - '0' < s[s.size() - 1] - '0') {
        break;
      }
    }
  }
  if (pos == -1) {
    cout << -1;
  } else {
    swap(s[pos], s[s.size() - 1]);
    cout << s;
  }
}
